One Way Sync of a Bucket With Local Directory

Posted by user48651 on Server Fault See other posts from Server Fault or by user48651
Published on 2012-11-17T19:09:42Z Indexed on 2012/11/17 23:05 UTC
Read the original article Hit count: 274

Filed under:
|

I have a local directory that I would like to synchronize with an S3 bucket. I have two specific requirements:

  1. If local file is the same as the remote, do not re-transfer it to the bucket.
  2. If some files or directories exist in the bucket but do not exist on local, delete them. Basically the bucket should mirror the local copy and not vice-versa.

I looked into s3cmd sync command, but unfortunately requirement 2 is not fulfilled. If files exists in the bucket but not on local copy, they will be copied to the local instead of being deleted.

© Server Fault or respective owner

Related posts about amazon-s3

Related posts about s3cmd