X-Git-Url: http://andersk.mit.edu/gitweb/sql.git/blobdiff_plain/8145dbcc1f707acb781583a288f55923866d6be2..450142dd733b96d64172176908b2c2f9b2a954e0:/libexec/cron-daily-local.sh diff --git a/libexec/cron-daily-local.sh b/libexec/cron-daily-local.sh index 0b926bb..7746deb 100755 --- a/libexec/cron-daily-local.sh +++ b/libexec/cron-daily-local.sh @@ -1,9 +1,9 @@ #!/bin/bash -NEWBF=/srv/backup/daily/sql.mit.edu_`date +%m-%d-%Y`.sql.gz - -/usr/bin/mysqldump -umit-backup -efqQK --all-databases | gzip > $NEWBF - -if [[ -s $NEWBF && `ls /srv/backup/daily/ | wc -l` -ge 4 ]]; then - rm -f /srv/backup/daily/`ls -t /srv/backup/daily/ | tail -n1` +if [[ -s /srv/mysql/master.info ]]; then + NEWBF=/srv/backup/daily/sql.mit.edu_`date +%Y-%m-%d`.sql.gz + /usr/bin/mysqldump -umit-backup -efqQK --all-databases | gzip > $NEWBF + if [[ -s $NEWBF && `ls /srv/backup/daily/ | wc -l` -ge 4 ]]; then + rm -f /srv/backup/daily/`ls -t /srv/backup/daily/ | tail -n1` + fi fi