Fix logic to tell if 15 days have past since last backup.
[backups/.git] / scripts / cron-pack.sh
index a757da9a38a92456578303b880c5e4fede5d6bb4..2127e42b119b723be914f001b9d6c141ff1b15ab 100755 (executable)
@@ -4,7 +4,10 @@ export PATH=$(dirname $0):/bin:/usr/bin:/sbin
 
 . config.sh
 
-if [ -n "$(find $lastbackupfile -mtime +14)" -o -n "$(cat $statusfile | grep -i incomplete)" ]; then
+days=15
+minutes=$(($days * 1440 - 60))
+
+if [ -n "$(find $lastbackupfile -mmin +$minutes)" -o -n "$(cat $statusfile | grep -i incomplete)" ]; then
   echo "Running backups from cron..."
   setsid pack-image.sh
   exit 0