Don't check for the existence of sourcedir in the restore script. It may not
[backups/.git] / scripts / restore-script.sh
index 9d9baabc9389a496e5a0db8771844331befe7f6b..0796bef2d9155e5d1e99e1a52f66f4bd97710af0 100755 (executable)
@@ -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> <relocate-dir> [<mnt-dir>]
        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