aboutsummaryrefslogtreecommitdiffstats
path: root/chapter6/backup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'chapter6/backup.sh')
-rw-r--r--chapter6/backup.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/chapter6/backup.sh b/chapter6/backup.sh
index f2f0d64..6d23c27 100644
--- a/chapter6/backup.sh
+++ b/chapter6/backup.sh
@@ -9,12 +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}" "${directories[@]}" & pid=$!
+ sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" >/dev/null 2>&1 & pid=$!
spinner "$pid"
retval=$?
if [ "$retval" -ne 0 ]; then
- printf "%b" "${RED}Backup FAILED!${RST}\n"
- exit 1
+ printf "%b" "${RED}FAILED!${RST}\n"
+ exit "${retval}"
else
sudo chown "${USER}" "${HOME}"/"${file}"
printf "%b" "${GRN}OK${RST}\n"
@@ -23,5 +23,3 @@ else
touch "${LFS}/sources/chapter6/backup"
fi
-
-unset file directories