dev="/dev/dvdrw"
sdev="ATA:1,0,0"
noburnfile="$imagedir/noburn"
+backupeveryXdays=15
# These are exported so lsbackups can have access to them
export backupdbin="$datadir/backups.db"
# source the system specific configuration
[ -f /etc/lsbackups.conf ] && . /etc/lsbackups.conf
-days=15
-minutes=$(($days * 1440 - 60))
+minutes=$(($backupeveryXdays * 1440 - 60))
if [ -n "$(find $lastbackupfile -mmin +$minutes)" -o -n "$(cat $statusfile | grep -i incomplete)" ]; then
echo "Running backups from cron..."
isomountdir="$isoimage.mnt"
restorescript="$scriptsdir/restore.sh"
+echo "-> Checking for available disk space on $imagedir"
+available=$(df $imagedir | awk '{print$4}' | grep -E "[0-9]+")
+required=$((imagesizemb*1024))
+[ $required -gt $available ] && err "Not enough space for the backup image on $imagedir"
+
echo "-> Creating directories"
mkdir --mode=700 -p $datadir $imagedir $isomountdir $tmpdir
if [ $? != 0 ]; then