]> Dogcows Code - chaz/tar/blobdiff - scripts/restore.in
(restore_fs): Use root_fs
[chaz/tar] / scripts / restore.in
index 70b5b08ca11b28b961e7fda7f2e0eca80c8420dc..c35bdebe7862538fc9b5b3676ddc89d0897ef2cb 100644 (file)
 
 # Load library routines
 SYSCONFDIR=${SYSCONFDIR-@sysconfdir@}
-. ${LIBPATH-@libexecdir@}/backup.sh
+. ${LIBDIR-@libexecdir@}/backup.sh
 
 usage() {
        cat - <<EOF
 usage: $PROGNAME [OPTIONS] [PATTERN [PATTERN...]]
 Options are:
 
-   -l, --level=LEVEL       Start restoring from backup level LEVEL (default $DUMP_LEVEL).
+   -a, --all               Restore all filesystems.
+   -l, --level=LEVEL       Start restoring from the given backup LEVEL
+                           (default $DUMP_LEVEL).
    -v, --verbose[=LEVEL]   Set verbosity level. Default 100.
 
 Informational options:   
@@ -53,6 +55,9 @@ do
       optarg=$opt
   fi
   case $option in
+  -a|--a|--al|--all)
+        RESTORE_ALL=1
+        ;;
   --l=*|--le=*|--lev=*|--leve=*|--level=*)
          DUMP_LEVEL=$optarg
         ;;
@@ -85,6 +90,13 @@ do
   esac 
 done    
 
+if [ -z "$RESTORE_ALL" ]; then
+       if [ -z "$PATTERN" ]; then
+               usage
+               exit;
+       fi
+fi     
+
 init_restore
 cat > $LOGFILE <<EOF
 This file contains any messages produced by $PROGNAME.
@@ -99,6 +111,7 @@ EOF
 restore_fs()
 {
     fs="`echo \"${1}\" | sed -e 's/^.*://'`"
+    fs=`root_fs $fs`
     fsname="`echo \"${1}\" | sed -e 's/\//:/g'`"
     remotehost="`expr \"${1}\" : '\([^/][^/]*\):.*'`"
     if [ -z "$remotehost" ]; then
@@ -132,9 +145,9 @@ restore_fs()
       LABEL="`print_level $level` backup of ${fs} on ${remotehost} at ${DATE}"
       ${RESTORE_BEGIN-:} $level $remotehost $fs $fsname
       backup_host ${remotehost} \
-                  "--listed=`level_log_name $fs $level`" \
+                  "--listed=\"$FILE\"" \
                   "--label=\"$LABEL\"" \
-                 -C ${ROOT_FS-/}$fs
+                 -C $fs
       ${RESTORE_END-:} $level $remotehost $fs $fsname            
     done
 }
@@ -164,7 +177,7 @@ restore_files()
       LABEL="`print_level $level` backup of miscellaneous files at ${DATE}"
       ${RESTORE_BEGIN-:} $level $localhost MISC MISC
       backup_host ${localhost} \
-                  "--listed=`level_log_name MISC $level`" \
+                  "--listed=\"$FILE\"" \
                   "--label=\"$LABEL\"" \
                  -C ${ROOT_FS-/} $@
       ${RESTORE_END-:} $level $localhost MISC MISC
@@ -221,4 +234,4 @@ fi) 2>&1 | tee -a "${LOGFILE}"
     
     
           
-       
\ No newline at end of file
+       
This page took 0.022963 seconds and 4 git commands to generate.