Created
March 28, 2016 17:31
-
-
Save varnav/d3d128d4887818b53b8b 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/sh | |
# | |
MyBackup="mysql.backup.`date +%Y.%m.%d.at.%H.%M.%S`.tbz" | |
MyBackup2="etcdir.backup.`date +%Y.%m.%d.at.%H.%M.%S`.tbz" | |
MyBackup3="wwwdir.backup.`date +%Y.%m.%d.at.%H.%M.%S`.tbz" | |
MyBackup4="varlib.backup.`date +%Y.%m.%d.at.%H.%M.%S`.tbz" | |
rm -f /astdb/backups/backup.sql | |
/usr/bin/mysqldump -udump -pdump --skip-add-drop-table --single-transaction --all-databases > /astdb/backups/backup.sql | |
cd /astdb/backups/ | |
tar cjf $MyBackup backup.sql | |
rm -f /astdb/backups/backup.sql | |
#scp /var/backups/`$MyBackup`.tgz user@host:/my/backup/dir | |
tar cjf /astdb/backups/$MyBackup2 /etc/ | |
tar cjf /astdb/backups/$MyBackup3 /var/www/html/ | |
tar cjf /astdb/backups/$MyBackup4 /var/lib/asterisk/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment