You need the following two details in order to communicate with S3.
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.