Created
April 20, 2010 16:50
-
-
Save dennmart/372741 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 | |
echo "Deleting dennmart.com archive for $(date +%A) if it exists..." | |
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -d -f dennmart.com-daily-$(date +%A) | |
echo "Creating dennmart.com archive for $(date +%A)..." | |
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -c -f dennmart.com-daily-$(date +%A) /var/www/dennmart.com | |
echo "Making temporary database dump..." | |
mysqldump -u root -pxxxxxx --all-databases --add-drop-table > /tmp/mysqldump.sql | |
echo "Deleting database dump archive for $(date +%A) if it exists..." | |
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -d -f mysqldump-daily-$(date +%A) | |
echo "Creating database dump archive for $(date +%A)..." | |
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -c -f mysqldump-daily-$(date +%A) /tmp/mysqldump.sql | |
echo "Deleting temporary database dump..." | |
rm -f /tmp/mysqldump.sql |
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 | |
echo "Deleting dennmart.com archive if it exists..." | |
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -d -f dennmart.com-$(date +%B%Y) | |
echo "Creating dennmart.com archive for $(date +%B-%Y)..." | |
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -c -f dennmart.com-$(date +%B%Y) /var/www/dennmart.com | |
echo "Making temporary database dump..." | |
mysqldump -u root -pxxxxxx --all-databases --add-drop-table > /tmp/mysqldump.sql | |
echo "Deleting database dump archive if it exists..." | |
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -d -f mysqldump-$(date +%B%Y) | |
echo "Creating database dump archive for $(date +%B-%Y)..." | |
tarsnap --cachedir /usr/local/tarsnap-cache --keyfile /root/tarsnap.key -c -f mysqldump-$(date +%B%Y) /tmp/mysqldump.sql | |
echo "Deleting temporary database dump..." | |
rm -f /tmp/mysqldump.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment