prefixing exclude directories

This commit is contained in:
Sylvain Chevallier 2017-01-11 16:30:27 +01:00
parent 0e042e7523
commit d1372b0230

View file

@ -96,18 +96,18 @@ shift;OPTIONS="$@"
# Excludes:
EXCLUDES="\
--exclude=home/*/.bash_history \
--exclude=dev/* \
--exclude=media/* \
--exclude=mnt/*/* \
--exclude=proc/* \
--exclude=run/* \
--exclude=sys/* \
--exclude=tmp/* \
--exclude=usr/portage/* \
--exclude=var/lock/* \
--exclude=var/log/* \
--exclude=var/run/*"
--exclude=${TARGET}/home/*/.bash_history \
--exclude=${TARGET}/dev/* \
--exclude=${TARGET}/media/* \
--exclude=${TARGET}/mnt/*/* \
--exclude=${TARGET}/proc/* \
--exclude=${TARGET}/run/* \
--exclude=${TARGET}/sys/* \
--exclude=${TARGET}/tmp/* \
--exclude=${TARGET}/usr/portage/* \
--exclude=${TARGET}/var/lock/* \
--exclude=${TARGET}/var/log/* \
--exclude=${TARGET}/var/run/*"
if [ "$TARGET" == "/" ]
then
@ -116,12 +116,12 @@ fi
if [ ${EXCLUDE_CONNMAN} -eq 1 ]
then
EXCLUDES+=" --exclude=var/lib/connman/*"
EXCLUDES+=" --exclude=${TARGET}/var/lib/connman/*"
fi
if [ ${EXCLUDE_BOOT} -eq 1 ]
then
EXCLUDES+=" --exclude=boot/*"
EXCLUDES+=" --exclude=${TARGET}/boot/*"
fi
if [ ${EXCLUDE_LOST} -eq 1 ]
@ -145,7 +145,7 @@ then
echo "example: \$ `basename $0` -s /my-backup --exclude=/etc/ssh/ssh_host*"
echo ""
echo "COMMAND LINE PREVIEW:"
echo "cd $TARGET && tar $TAR_OPTIONS -f $STAGE4_FILENAME * $EXCLUDES $OPTIONS"
echo "tar $TAR_OPTIONS -f $STAGE4_FILENAME * $EXCLUDES $OPTIONS"
echo ""
echo -n "Type \"yes\" to continue or anything else to quit: "
read AGREE
@ -154,7 +154,7 @@ fi
# start stage4 creation:
if [ "$AGREE" == "yes" ]
then
cd $TARGET && tar $TAR_OPTIONS -f $STAGE4_FILENAME * $EXCLUDES $OPTIONS
tar $TAR_OPTIONS $OPTIONS -f $STAGE4_FILENAME * $EXCLUDES
fi
exit 0