diff options
-rw-r--r-- | chapter6/backup.sh | 5 | ||||
-rw-r--r-- | chapter6/cleanup.sh | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/chapter6/backup.sh b/chapter6/backup.sh index 0cbd314..6ffe768 100644 --- a/chapter6/backup.sh +++ b/chapter6/backup.sh @@ -1,7 +1,7 @@ #!/bin/bash FILE="${LFS_VER}-ch6-backup.tar.xz" -DIRS="bin etc lib lib64 sbin tools usr var" +DIRS=(bin etc lib lib64 sbin tools usr var) if [ -f "${LFS}/sources/chapter6/backup" ]; then echo -e "${GRN}Backup found. Remove manually to backup again.${RST}" @@ -9,11 +9,12 @@ else echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${FILE}${RST}... " pushd "${LFS}" > /dev/null || exit 1 - sudo XZ_OPTS="-T${NUMPROCS} -e" tar -cJpf "${HOME}"/"${FILE}" "${DIRS}" & pid=$! + sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${FILE}" "${DIRS[@]}" & pid=$! spinner "$pid" retval=$? if [ "$retval" -ne 0 ]; then echo -e "${RED}Backup FAILED!${RST}" + exit 1 else sudo chown "${USER}" /home/"${USER}"/"${FILE}" echo -e "${GRN}OK${RST}" diff --git a/chapter6/cleanup.sh b/chapter6/cleanup.sh index 8d31264..cd620d3 100644 --- a/chapter6/cleanup.sh +++ b/chapter6/cleanup.sh @@ -13,7 +13,7 @@ else rm -rf "${LFS}"/usr/share/info >/dev/null 2>&1 rm -rf "${LFS}"/usr/share/man >/dev/null 2>&1 - strip --strip-debug "${LFS}"S/usr/lib/* >/dev/null 2>&1 + strip --strip-debug "${LFS}"/usr/lib/* >/dev/null 2>&1 strip --strip-unneeded "${LFS}"/usr/bin/* >/dev/null 2>&1 strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1 strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1 |