From a0692dd9a26a99eeb945724c0ff1a0f108c71758 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Jun 2016 15:11:47 +0100 Subject: [PATCH] Scriptlog and added info_distro.sh --- lgsm/functions/command_backup.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 904e76ba4..a9f8f74eb 100644 --- a/lgsm/functions/command_backup.sh +++ b/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 "" \ No newline at end of file +echo "" +core_exit.sh \ No newline at end of file