How can I use Amazon S3 bucket to synchronize files and folders from a local Linux server to? AWS

You need the following two details in order to communicate with S3.

  1. Credentials for an IAM user with read-write access to an S3 bucket.
  2. A client such as bash’s aws-cli, Python’s boto library, and so on.

Once you have these details, you are ready to move your files. You can move them from your Linux server to Amazon S3 bucket and vice versa. The aws-cli example is shown below.

To synchronize all the files in a folder, you can use aws cli the following command

aws s3 sync /home/abc/public html/ s3:/abc-test/webroot/ aws s3 sync /home/abc/public html/ aws s3 sync /home/abc/public html

To copy a single file to Amazon S3 bucket, you can use the following command

aws s3 cp source file s3:/ s3:/abc-test/webroot/ aws s3 cp source file s3:/ s3:/abc-test/webroot/

If you want to download any file from Amazon S3 bucket, you have to just replace the source with the destination in the command.

To exclude several folders when using AWS S3 Sync, you can use the following command.

aws s3 sync /home/abc/public html/ s3:/abc-test/webroot/ —exclude ‘blog images/* soon/*’

At Velan, our server support engineers can assist you in installing and configuring Amazon S3 bucket to backup important data on your servers. If you wish to avail any of our services, please fill the Quick connect form and get in touch with us.

Credentials

Quick Connect With Us

captcha reload