From: Carl N. Baldwin Date: Sun, 30 Oct 2005 22:10:34 +0000 (-0700) Subject: More more more X-Git-Tag: release-0.4~37 X-Git-Url: http://git.pippins.net/embedvideo/images/%27%20%20%20%20.%20%24GLOBALS%5B%27phpgw%27%5D-%3Elink%28%27inc/jquery/static/.%24link.?a=commitdiff_plain;h=cb3e8792568ba258b606cfe5f30db716f5d3ae4d;p=backups%2F.git More more more --- diff --git a/scripts/burn-imgs.sh b/scripts/burn-imgs.sh index a3b6fb2..0e1a6bf 100755 --- a/scripts/burn-imgs.sh +++ b/scripts/burn-imgs.sh @@ -5,7 +5,8 @@ PATH=$(dirname $0):/bin:/usr/bin . config.sh # If the noburn file is there then don't burn. -[ -f "$burnlockfile" ] && exit 0 +[ -f "$noburnfile" ] && exit 0 +touch $noburnfile # Discover disk images by looking for .img.md5sum files in $imagedir imgmd5=$(ls $imagedir/*.img.md5sum | head -n 1) @@ -26,7 +27,7 @@ img=${imgmd5%.md5sum} # Burn the image to a disk. cdrecord-wrapper.sh -dao dev=$sdev $isoimage > $logfile 2>&1 -if [ 0 != "$?" ]; then +if [ "0" != "$?" ]; then echo >&2 "cdrecord failed!" exit 1 fi @@ -44,8 +45,6 @@ fi # Record the date in the stat file to indicate that this burn was a success date >> $img.stat -touch $burnlockfile - { # Send e-mail echo "Image md5sum:" cat $img.md5sum @@ -54,7 +53,7 @@ touch $burnlockfile cat $img.stat echo cat $logfile -} | mailx -s "DVD burned. File it as ${img%.*}" $mailto > $logfile 2>&1 +} | mailx -s "DVD burned. File as ${img%.*}" $mailto > $logfile 2>&1 # Two lines in the stat file indicate two successful burns. Clean-up the image. if [ "$(wc -l $img.stat 2>/dev/null)" == "2" ]; then diff --git a/scripts/config.sh b/scripts/config.sh index 4dc4350..056bb2c 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -3,15 +3,15 @@ mailto='carl@ecbaldwin.net' datadir="/var/lib/backups" tmpdir="/dev/shm/backups" +imagedir="/backup/imgs" currentfiles="$tmpdir/files.db" backupdb="$datadir/backups.db" backups="$tmpdir/backup-list.db" -statusfile="$tmpdir/backup-status.txt" -imagedir="/backup/imgs" +statusfile="$imagedir/backup-status.txt" lastbackupfile="$imagedir/lastbackup" dev="/dev/dvdrw" sdev="ATA:1,0,0" -burnlockfile="$imagedir/noburn" +noburnfile="$imagedir/noburn" backupdirs=" /etc diff --git a/scripts/cron.sh b/scripts/cron.sh index b4bf021..ab6b47d 100755 --- a/scripts/cron.sh +++ b/scripts/cron.sh @@ -4,7 +4,7 @@ export PATH=$(dirname $0):/bin:/usr/bin . config.sh -if [ -n "$(find $lastbackupfile -mtime +14)" ]; then +if [ -n "$(find $lastbackupfile -mtime +14)" -o -n "$(cat $statusfile | grep -i incomplete)" ]; then echo "Running backups from cron..." exec pack-image.sh fi diff --git a/scripts/eject-disk.sh b/scripts/eject-disk.sh index 713e45a..cca22ce 100755 --- a/scripts/eject-disk.sh +++ b/scripts/eject-disk.sh @@ -6,4 +6,4 @@ export PATH=$(dirname $0):/bin:/usr/bin eject $dev -rm -f $burnlockfile +rm -f $noburnfile