Merge pull request #9 from sylvchev/new_prefix

Using prefix via tar, no longer needing cd.
This commit is contained in:
Horea Christian 2017-01-11 23:35:54 +01:00 committed by GitHub
commit 9dd869c6d2

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 $EXCLUDES $OPTIONS -f $STAGE4_FILENAME *"
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 $EXCLUDES $OPTIONS -f $STAGE4_FILENAME *
tar $TAR_OPTIONS $OPTIONS -f $STAGE4_FILENAME * $EXCLUDES
fi
exit 0