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
# 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#' \
}