Created
December 13, 2012 19:27
-
-
Save adrinavarro/4279032 to your computer and use it in GitHub Desktop.
OVZ backup
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 | |
BASE="/var/lib/vz/backup/dump" | |
DAY=`date +%Y_%m_%d` | |
CURRENT=`ls ${BASE}/vzdump-openvz-100-${DAY}-*.tar.lzo` | |
/bin/mv $CURRENT ${BASE}/current.tar.lzo | |
/bin/rm ${BASE}/vzdump-* | |
/usr/local/bin/s3cmd mv s3://bucket/prod.tar.lzo s3://bucket/prod-prev.tar.lzo | |
/bin/sleep 5 | |
/usr/local/bin/s3cmd put ${BASE}/current.tar.lzo s3://bucket/prod.tar.lzo | |
/bin/sleep 5 | |
/bin/rm ${BASE}/current.tar.lzo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment