12456/delete-the-files-from-aws-except-recently-added-updated-files
I could fetch the recent 5 files added or updated by:
aws s3 ls s3://somebucket/ --recursive | sort | tail -n 5 | awk '{print $4}'
Now how do I keep these files and delete all other?
Use AWS s3 rm command with multiple --exclude options as shown:
aws s3 rm s3://somebucket/ --recursive --exclude "somebucket/1.txt" --exclude "somebucket/2.txt" --exclude "somebucket/3.txt" --exclude "somebucket/4.txt" --exclude "somebucket/5.txt"
I think the problem should be with ...READ MORE
This can be done by setting the ...READ MORE
Is your problem is not with the ...READ MORE
The answer is a definite yes yes. ...READ MORE
It can work if you try to put ...READ MORE
Hey @nmentityvibes, you seem to be using ...READ MORE
The awslogs works without using ECS. you need to configure ...READ MORE
Check if the FTP ports are enabled ...READ MORE
To Download using AWS S3 CLI : aws ...READ MORE
aws sync is not used for deleting ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.