diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-26 17:16:46 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-26 17:19:30 -0500 |
commit | dc9970b92ca782c11523252435a4878188d36c78 (patch) | |
tree | 0410d3bfab4d1c187064f24619d77352225ba6d3 /chapter6/backup.sh | |
parent | 5b08034d816a147435d8e7ebaae9f72f57a7ec44 (diff) |
Remove unset command at end and direct all output to /dev/null for tar.
Diffstat (limited to 'chapter6/backup.sh')
-rw-r--r-- | chapter6/backup.sh | 8 |
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 |