First step toward making the xfsdump inventory not break the FHS spec.
authorNathan Scott <nathans@sgi.com>
Wed, 3 Oct 2001 05:22:21 +0000 (05:22 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 3 Oct 2001 05:22:21 +0000 (05:22 +0000)
Previously, xfsdump wrote to /var/xfsdump for all its inventory data
needs.  This is now a runtime decision - for existing installations we
continue doing just that, for new installations we use the compliant-
with-FHS directory /var/lib/xfsdump.  Note: cannot just mv one to the
other as xfsdump is "clever" enough to store full pathnames in all its
inventory file - this issue will be resolved by Ivan in an upcoming
xfsinvutil checkin.

common.dump

index 9ba942d5a7d4ad35e7cb06c1214c07fdad58f3ab..9d918fb6344c2a8fb6a0beb3dfdba4061416eda1 100644 (file)
@@ -71,12 +71,12 @@ _need_to_be_root
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
 # start inventory from a known base - move it aside for test
-if [ -d /var/xfsdump/inventory ]; then
-    if [ -d /var/xfsdump/inventory.$seq ]; then    
-       rm -rf /var/xfsdump/inventory.$seq
+for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
+    if [ -d $dir ]; then
+       [ -d $dir.$seq ] && rm -rf $dir.$seq
+       mv $dir $dir.$seq
     fi
-    mv /var/xfsdump/inventory /var/xfsdump/inventory.$seq
-fi
+done
 
 
 #
@@ -250,16 +250,20 @@ _cleanup()
     rm -f $tmp.*
 
     if [ -n "$DEBUGDUMP" ]; then
-        # save it for inspection
-       tar -zcvf $seq.inventory.tgz /var/xfsdump/inventory
-       ls -lR /var/xfsdump/inventory >$seq.inventory.ls
+       # save it for inspection
+       for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
+           [ -d $dir ] || continue
+           tar -zcvf $seq.inventory.tgz $dir
+           ls -lR $dir >$seq.inventory.ls
+       done
     fi
 
     # put inventory dir back
-    if [ -d /var/xfsdump/inventory.$seq ]; then
-       rm -rf /var/xfsdump/inventory # get rid of new one
-       mv /var/xfsdump/inventory.$seq /var/xfsdump/inventory
-    fi
+    for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
+       [ -d $dir.$seq ] || continue
+       rm -rf $dir             # get rid of new one
+       mv $dir.$seq $dir
+    done
 
     if [ $status -ne $NOTRUNSTS ]; then
        # Sleep added to stop _check_fs from complaining that the
@@ -651,6 +655,7 @@ _dump_filter()
       -e '/mfile size:[         ]*/s/[1-9][0-9]*/NUM/' \
       -e '/\/dev\/tty/d' \
       -e '/inventory session uuid/d' \
+      -e 's#/var/lib/xfsdump#/var/xfsdump#' \
 
 }