From e2acade06300165258c6a65f964ee8a490e21ff9 Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Sun, 12 Jul 2020 10:26:07 -0500 Subject: [PATCH] Log backup jobs --- CHANGELOG.md | 1 + gravity-sync.sh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56abe28..94996e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Skipping a few digits because what does it really matter? - Uses new SQLITE3 backup methodology introduced in 2.1, for all push/pull sync operations. - `./gravity-sync.sh restore` lets you select a different `gravity.db` and `custom.list` for restoration. - One new Star Trek reference. +- `./gravity-sync.sh restore` now shows recent complete Backup executions. ## 2.0 ### The Smart Release diff --git a/gravity-sync.sh b/gravity-sync.sh index bc7e85f..4632284 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -749,6 +749,9 @@ function restore_gs { ## Core Logging ### Write Logs Out function logs_export { + + if [ "${TASKTYPE}" != "BACKUP" ] + then MESSAGE="Saving File Hashes" echo_stat rm -f ${LOG_PATH}/${HISTORY_MD5} @@ -757,6 +760,7 @@ function logs_export { echo -e ${primaryCLMD5} >> ${LOG_PATH}/${HISTORY_MD5} echo -e ${secondCLMD5} >> ${LOG_PATH}/${HISTORY_MD5} error_validate + fi MESSAGE="Logging Successful ${TASKTYPE}" echo_stat @@ -778,6 +782,8 @@ function logs_gs { tail -n 7 "${LOG_PATH}/${SYNCING_LOG}" | grep PULL echo -e "Recent Complete ${YELLOW}PUSH${NC} Executions" tail -n 7 "${LOG_PATH}/${SYNCING_LOG}" | grep PUSH + echo -e "Recent Complete ${YELLOW}BACKUP${NC} Executions" + tail -n 7 "${LOG_PATH}/${SYNCING_LOG}" | grep BACKUP echo -e "Recent Complete ${YELLOW}RESTORE${NC} Executions" tail -n 7 "${LOG_PATH}/${SYNCING_LOG}" | grep RESTORE echo -e "========================================================" @@ -1814,6 +1820,7 @@ function task_backup { backup_local_custom backup_cleanup + logs_export exit_withchange }