Chdir bug
This commit is contained in:
parent
9d0654d604
commit
a23d2b7815
@ -48,10 +48,16 @@ while read line; do
|
|||||||
# exclude file
|
# exclude file
|
||||||
EXCLUDE="exclude/${ARGS[1]}"
|
EXCLUDE="exclude/${ARGS[1]}"
|
||||||
|
|
||||||
|
CHDIR=$(dirname $FILE)
|
||||||
|
|
||||||
|
if [ -d $FILE ]; then
|
||||||
|
CHDIR="$FILE/../"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f $EXCLUDE ]; then
|
if [ -f $EXCLUDE ]; then
|
||||||
tar zcf "$BAKDIR/$BACKUPFILE" -C "$FILE/../" $FILENAME -X $EXCLUDE
|
tar zcf "$BAKDIR/$BACKUPFILE" -C $CHDIR $FILENAME -X $EXCLUDE
|
||||||
else
|
else
|
||||||
tar zcf "$BAKDIR/$BACKUPFILE" -C "$FILE/../" $FILENAME
|
tar zcf "$BAKDIR/$BACKUPFILE" -C $CHDIR $FILENAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# count backup file
|
# count backup file
|
||||||
|
Loading…
Reference in New Issue
Block a user