Sfoglia il codice sorgente

Scriptlog and added info_distro.sh

Daniel Gibbs 10 anni fa
parent
commit
a0692dd9a2
1 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  1. 8 4
      lgsm/functions/command_backup.sh

+ 8 - 4
lgsm/functions/command_backup.sh

@@ -10,9 +10,10 @@ local modulename="Backup"
 function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
+info_distro.sh
 backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"
 echo ""
-fn_print_info_nl "A total of $(du -sh "${rootdir}" --exclude="${backupdir}" | awk '{print $1}') will be compressed into the following backup:"
+fn_print_info_nl "A total of ${rootdirduexbackup} will be compressed into the following backup:"
 echo "${backupdir}/${backupname}.tar.gz"
 echo ""
 while true; do
@@ -38,14 +39,17 @@ if [ "${status}" != "0" ]; then
 	esac
 	done
 fi
-fn_script_log "Started backup"
+
 fn_print_dots "Backup in progress, please wait..."
+fn_script_log_info "Started backup"
 sleep 2
 if [ ! -d "${backupdir}" ]; then
 	mkdir "${backupdir}"
 fi
 tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "backups" ./*
+# NOTE: Need to add error checking for tar.
 fn_print_ok_nl "Backup created: ${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
-fn_script_log "Complete, Backup created: ${backupdir}/${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
+fn_script_log_pass "Backup created: ${backupdir}/${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
 sleep 1
-echo ""
+echo ""
+core_exit.sh