2016-01-11 11:00:55 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
LOG_FILE=/var/log/mysql-backup.log
|
|
|
|
if [ -x /etc/cron.daily/duplicity_backup ] ; then
|
|
|
|
echo "duplicity backups active. Exiting" > $LOG_FILE
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-03-21 14:40:56 +01:00
|
|
|
# Remote backup performed by BackupPC. If it is active, do not run via cron
|
|
|
|
if [ -f /var/log/backuppc.log ] ; then
|
|
|
|
TMSTMP=$( date +%s )
|
|
|
|
. /var/log/backuppc.log
|
|
|
|
LAST_BACKUP_TIME=$( expr $TMSTMP - $BACKUP_TIMESTAMP )
|
2017-04-28 19:56:20 +02:00
|
|
|
if [ $LAST_BACKUP_TIME -lt 86400 -a $BACKUP_RESULT == 'OK' ] ; then
|
2016-03-21 14:40:56 +01:00
|
|
|
echo "BackupPC is active, doing nothing" > $LOG_FILE
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-01-11 11:00:55 +01:00
|
|
|
/usr/local/sbin/mysql-backup > $LOG_FILE 2>&1
|
|
|
|
|
|
|
|
exit 0
|