From: Nathan Scott Date: Wed, 3 Oct 2001 05:22:21 +0000 (+0000) Subject: First step toward making the xfsdump inventory not break the FHS spec. X-Git-Tag: v1.1.0~1203 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=52b1c1c45ee75e47250247cc7ed1db8a49c66071;p=users%2Fhch%2Fxfstests-dev.git 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. --- diff --git a/common.dump b/common.dump index 9ba942d5a..9d918fb63 100644 --- a/common.dump +++ b/common.dump @@ -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#' \ }