]> Dogcows Code - chaz/tar/commitdiff
Renamed LIBPATH to LIBDIR.
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 19 Aug 2004 13:09:37 +0000 (13:09 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 19 Aug 2004 13:09:37 +0000 (13:09 +0000)
New option -a (--all). Do not start restore unless
-a or patterns are given.
(restore_fs,restore_files): Fixed use of --listed option.

scripts/restore.in

index 70b5b08ca11b28b961e7fda7f2e0eca80c8420dc..88ab1fa9675530f415cbbfb72c25de84269f3630 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.
@@ -132,7 +144,7 @@ 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
       ${RESTORE_END-:} $level $remotehost $fs $fsname            
@@ -164,7 +176,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
This page took 0.024191 seconds and 4 git commands to generate.