简体   繁体   中英

Use AWS CLI to sync files on Windows instance to AWS S3 bucket and delete older files (without storage gateway or FSx)

As my title says I'm looking for a way to use the AWS CLI commands (or other free/cheap methods) to sync local backups on my Windows machine to S3 and then also delete the oldest file or files older than a set number of days from S3.

We can't afford storage gateway solution, and due to account security cannot use FSx.

Any help is much appreciated!

It's easy to achieve this;

  1. Install AWS CLI utility in Windows
  2. Configure AWS CLI with access and secret keys
  3. Create a Bucket in S3
  4. Use S3 sync command to upload backups to S3
  5. Set lifecycle policy on S3 bucket to remove files from S3 after certain time

Ref:

https://docs.aws.amazon.com/cli/latest/userguide/install-windows.html https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html https://docs.aws.amazon.com/AmazonS3/latest/dev-retired/object-lifecycle-mgmt.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM