How to Backup files to Amazon S3
Amazon S3 (Simple Storage Service) is a cloud computing web service offered by Amazon Web Services (AWS). Amazon S3 provides object storage through web services interfaces. This article describes how to automate backup to Amazon S3
Step 1 : Create an AWS IAM User
1. Click here to open AWS Console. Go to Services and select IAM (Identity and Access Management)
2. From the IAM Console, Click users on the left side
3. Click Add user button
4. On Add user window, enter user name,Access type and Password. Click Next for Permission
5. Click on Attach existing policies directly option. Select AdministratorAccess then click Next for Review
6. Click on Create user button
7. Click the Download Credentials button and save the credentials.csv file and then click Close button
Step 2: Install and Configure the AWS CLI
Linux Windows
AWS CLI Installation Steps for Linux
1. Download AWS CLI Bundle from here or
$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
2. Extract AWS CLI Bundle
$ unzip awscli-bundle.zip
3. Install AWS CLI Bundle
$ ./awscli-bundle/install -b ~/bin/aws
AWS CLI Configuration Step
$ /root/bin/aws configure
AWS Access Key ID [None]: enter the Access Key Id
WS Secret Access Key [None]: enter the Secret Access Key
Default region name [None]: ap-south-1
Default output format [None]: json
Unistall AWS CLI
$ sudo rm -rf /usr/local/aws$ sudo rm /usr/local/bin/aws
Step 3: Configure Crontab for auto backup upload
To install and Configure Crontab for please read my previous article : https://www.admincool.com/2016/09/how-to-scheduling-crontab-for-backup.html
Add the following line to Crontab and restart crond service to upload backup files to your Amazon S3 Bucket (apply changes as with your configurations)
In Crontab:
00 01 * * * /root/bin/aws s3 cp /EBS-80GB/Autobackups/BAYAFA/bayaFA.backup s3://Bayyyyy-backups/BAYAFA/bayaFA_$(date +\%d\%m\%Y).backup
No comments: