From 91a649790f76170c3d1a84bd4e18af005c7843c1 Mon Sep 17 00:00:00 2001 From: "Carl N. Baldwin" Date: Tue, 29 Nov 2005 19:27:41 -0700 Subject: [PATCH] Don't check for the existence of sourcedir in the restore script. It may not be there. Also, be strict about sourcedir being an actual directory. --- scripts/restore-script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore-script.sh b/scripts/restore-script.sh index 9d9baab..0796bef 100755 --- a/scripts/restore-script.sh +++ b/scripts/restore-script.sh @@ -12,7 +12,7 @@ function err() { export PATH=${rundir%%/}:/bin:/usr/bin:/sbin:/usr/sbin:/sw/bin -if [ ! -d "$mountdir$1" -o ! -d "$2" ]; then +if [ ! -z "$1" -o ! -d "$2" ]; then err " Usage: $0 [] source-dir - directory on backup disks to restore from (relative to $mountdir) @@ -57,5 +57,5 @@ for date in $dates; do done rsyncopts="-W -H -S -l -p -t -g -o -0 --files-from=- --stats --progress" - cat $dbfile | files-from-date.sh $date | grep -z -Z -e "^${1}" | rsync $rsyncopts ${mountdir%%/}/ ${2%%/}/ + cat $dbfile | files-from-date.sh $date | grep -z -Z -e "^${1%/}/" | rsync $rsyncopts ${mountdir%%/}/ ${2%%/}/ done -- 2.34.1