-
Notifications
You must be signed in to change notification settings - Fork 0
Devops: Backup AWS S3 Script
Oscar Fabiano edited this page Jul 6, 2021
·
1 revision
reference: https://stackoverflow.com/questions/17832860/backup-strategies-for-aws-s3-bucket
sudo apt-get install awsclisudo mkdir -p /home/ubuntu/s3/{bucket_name}aws s3 sync s3://{bucket_name} /home/ubuntu/s3/{bucket_name}/ GNU nano 4.8 /home/ubuntu/s3/sync.sh
#!/bin/sh
# Echo the current date and time
echo '-----------------------------'
date
echo '-----------------------------'
echo ''
# Echo script initialization
echo 'Syncing remote S3 bucket...'
# Actually run the sync command (replace {BUCKET_NAME} with your S3 bucket name)
/usr/bin/aws s3 sync s3://warrantyclaimsbucket /home/ubuntu/s3/warrantyclaimsbucket/
# Echo script completion
echo 'Sync complete'