906b010ac1c15048a5cda03e48174df938c8f3fd
[backups/.git] / scripts / cron-pack.sh
1 #!/bin/sh
2
3 export PATH=$(dirname $0):/bin:/usr/bin:/sbin
4
5 # source the default configuration
6 . config.sh
7
8 # source the system specific configuration
9 [ -f /etc/lsbackups.conf ] && . /etc/lsbackups.conf
10
11 days=15
12 minutes=$(($days * 1440 - 60))
13
14 if [ -n "$(find $lastbackupfile -mmin +$minutes)" -o -n "$(cat $statusfile | grep -i incomplete)" ]; then
15   echo "Running backups from cron..."
16   setsid pack-image.sh
17   exit 0
18 fi
19
20 echo "Not running backups today.  Backups were last run on $(<$lastbackupfile)"