Here is a step by step guide on how to backup your data to amazon S3. At end of this tutorial you will be able to create a bash script to sync your data to amazon S3.
For security purpose let’s create a separate user for S3 access.
Let’s configure an aws profile to use credentials we have created.
First install AWS CLI according to following guide,
Issue following command to verify your AWS CLI setup.
If you get the CLI version you are ready to go!
Once you have successfully installed, open a command prompts and issue following command to create a AWS CLI profile.
aws configure --profile my-s3
You can use any name for the profile.
You will be asked for your credentials and region. Provide all your details correctly.
Use following bash script to backup your data to amazon S3.
#!/bin/bash aws_profile=my-s3 backup_path=/home/me/backup bucket_name=my-backup aws s3 sync $backup_path s3://$bucket_name --storage-class=STANDARD_IA --profile=$aws_profile
You can find more details about these options from: http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html