Created
March 12, 2013 10:52
-
-
Save sydlawrence/5141976 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TIMESTAMP=`date +%F-%H%M` | |
S3_BUCKET_NAME="wmasbackups" #replace with your bucket name on Amazon S3 | |
S3_BUCKET_PATH="user-backups" | |
USER_NAME="syd" | |
echo "compressing user folder" | |
# Compressing | |
tar cf $USER_NAME-$HOSTNAME-$TIMESTAMP.tar /home/$USER_NAME/ | |
echo "backing up /home/$USER_NAME/ to s3://$S3_BUCKET_NAME/$S3_BUCKET_PATH/$USER_NAME-$HOSTNAME-$TIMESTAMP/" | |
# Upload to S3 | |
s3cmd put $USER_NAME-$HOSTNAME-$TIMESTAMP.tar s3://$S3_BUCKET_NAME/$S3_BUCKET_PATH/$USER_NAME-$HOSTNAME-$TIMESTAMP.tar | |
echo "all backed up :)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment