First step toward making the xfsdump inventory not break the FHS spec.

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.
This commit is contained in:
Nathan Scott
2001-10-03 05:22:21 +00:00
parent f63a5c41fd
commit 52b1c1c45e
+17 -12
View File
@@ -71,12 +71,12 @@ _need_to_be_root
trap "_cleanup; exit \$status" 0 1 2 3 15 trap "_cleanup; exit \$status" 0 1 2 3 15
# start inventory from a known base - move it aside for test # start inventory from a known base - move it aside for test
if [ -d /var/xfsdump/inventory ]; then for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
if [ -d /var/xfsdump/inventory.$seq ]; then if [ -d $dir ]; then
rm -rf /var/xfsdump/inventory.$seq [ -d $dir.$seq ] && rm -rf $dir.$seq
mv $dir $dir.$seq
fi fi
mv /var/xfsdump/inventory /var/xfsdump/inventory.$seq done
fi
# #
@@ -250,16 +250,20 @@ _cleanup()
rm -f $tmp.* rm -f $tmp.*
if [ -n "$DEBUGDUMP" ]; then if [ -n "$DEBUGDUMP" ]; then
# save it for inspection # save it for inspection
tar -zcvf $seq.inventory.tgz /var/xfsdump/inventory for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
ls -lR /var/xfsdump/inventory >$seq.inventory.ls [ -d $dir ] || continue
tar -zcvf $seq.inventory.tgz $dir
ls -lR $dir >$seq.inventory.ls
done
fi fi
# put inventory dir back # put inventory dir back
if [ -d /var/xfsdump/inventory.$seq ]; then for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
rm -rf /var/xfsdump/inventory # get rid of new one [ -d $dir.$seq ] || continue
mv /var/xfsdump/inventory.$seq /var/xfsdump/inventory rm -rf $dir # get rid of new one
fi mv $dir.$seq $dir
done
if [ $status -ne $NOTRUNSTS ]; then if [ $status -ne $NOTRUNSTS ]; then
# Sleep added to stop _check_fs from complaining that the # 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 '/mfile size:[ ]*/s/[1-9][0-9]*/NUM/' \
-e '/\/dev\/tty/d' \ -e '/\/dev\/tty/d' \
-e '/inventory session uuid/d' \ -e '/inventory session uuid/d' \
-e 's#/var/lib/xfsdump#/var/xfsdump#' \
} }