Wednesday, October 5, 2022

[SOLVED] S3 versioning: only copy files if they are new or changed

Issue

I'm running a cron job in a EC2 instance that backups a database dump and a folder (with files and subfolders) in a S3 bucket.

I only want to backup new and modified files in order to save costs. Is this possible?

I'm currently using aws cp, maybe there is an argument or another command?

thanks


Solution

Use aws s3 sync instead of aws s3 cp and it will do this automatically for you.



Answered By - Nick Humrich
Answer Checked By - Timothy Miller (WPSolving Admin)