From d1372b0230cac08646aa4de83469014fb3b08ab2 Mon Sep 17 00:00:00 2001 From: Sylvain Chevallier Date: Wed, 11 Jan 2017 16:30:27 +0100 Subject: [PATCH] prefixing exclude directories --- mkstage4.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mkstage4.sh b/mkstage4.sh index 5753b31..19293d0 100755 --- a/mkstage4.sh +++ b/mkstage4.sh @@ -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