Sync your aws important file with s3 bucket in a simple way

Let us assume your databse storage folder is /var/lib/mongo ,which wants to keep daily sync using s3 bucket in order to recover the data due to unexpected server failure

-First do SSH login to the AWS ec2 instance and then do the follwing confuguration setup.

# aws configure
AWS Access Key ID [None]: xxxxxxxxxxxxxxxxxxx //Your AWS Key
AWS Secret Access Key [None]: yyyyyyyyyyyyyyyyyyyyyyyy //Your Secret Key
Default region name [None]: us-east-1
Default output format [None]: ENTER

 

then please enter the following command

aws s3 sync /var/lib/mongo  s3://YourBucketName/database/

 

if u want to setup daily sync then just go to crontab and add the above command with the prefer time .

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s