From: Carl N Baldwin Date: Wed, 30 Nov 2005 02:46:56 +0000 (-0700) Subject: Silly cosmetic changes I probably don't need to make X-Git-Tag: release-0.4~6 X-Git-Url: http://git.pippins.net/embedvideo/.git/static/images/%7Beqpres_ppi_link%7D?a=commitdiff_plain;h=00cc94878d3cf4de6b6739e22e49d3c568388b89;p=backups%2F.git Silly cosmetic changes I probably don't need to make --- diff --git a/scripts/restore-script.sh b/scripts/restore-script.sh index daff5e5..ed42a96 100755 --- a/scripts/restore-script.sh +++ b/scripts/restore-script.sh @@ -10,7 +10,7 @@ function err() { [ -z "$mountdir" ] && err '$mountdir must be set' [ -z "$rundir" ] && err '$rundir must be set' -export PATH=${rundir%%/}:/bin:/usr/bin:/sbin:/usr/sbin:/sw/bin +export PATH=${rundir%/}:/bin:/usr/bin:/sbin:/usr/sbin:/sw/bin if [ ! -z "$1" -o ! -d "$2" ]; then err " @@ -27,19 +27,19 @@ Usage: $0 [] " fi -device=$(mount | grep "on ${mountdir%%/} " | awk '{print$1}') +device=$(mount | grep "on ${mountdir%/} " | awk '{print$1}') [ -z "$device" ] && err "Cannot determine cdrom device" -cp ${mountdir%%/}/backups.db ${mountdir%%/}/backup-status.txt $rundir -dbfile=${rundir%%/}/backups.db +cp ${mountdir%/}/backups.db ${mountdir%/}/backup-status.txt $rundir +dbfile=${rundir%/}/backups.db dates=$(cat $dbfile | list-dates.sh) for date in $dates; do filelist=$(tempfile) # Check to see if files are actually needed from the current disk before requesting it. - cat $dbfile | files-from-date.sh $date | grep -z -Z -e "^${1%%/}/" > $filelist + cat $dbfile | files-from-date.sh $date | grep -z -Z -e "^${1%/}/" > $filelist if [ -s $filelist ]; then success=false while ! $success; do @@ -51,9 +51,9 @@ for date in $dates; do eject -t $device # Mount the media - mount -t ext2 $device ${mountdir%%/} + mount -t ext2 $device ${mountdir%/} - if grep -q $date ${mountdir%%/}/backup-status.txt; then + if grep -q $date ${mountdir%/}/backup-status.txt; then success=true else echo "This doesn't seem to be the right disk." @@ -61,7 +61,7 @@ for date in $dates; do done rsyncopts="-W -H -S -l -p -t -g -o -0 --files-from=- --stats --progress" - cat $filelist | rsync $rsyncopts ${mountdir%%/}/ ${2%%/}/ + cat $filelist | rsync $rsyncopts ${mountdir%/}/ ${2%/}/ else echo "No files are needed from disk: $date. Skipping it." fi