WIP: Add debug messages

This commit is contained in:
Jeremy Gardais 2019-10-18 19:26:42 +02:00
parent 9c88629696
commit 3ad60f6f39
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 6 additions and 1 deletions

View File

@ -88,13 +88,18 @@ fi
# }}}
# Stop the container service {{{
systemctl stop "${ct_service_name}"
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Service management — Service ${ct_service_name} was stopped."
# }}}
# Backup container data {{{
## Create the directory to store archive if doesn't already exist
[ -d "${ct_backup_path}" ] || mkdir -p -- "${ct_backup_path}"
if [ ! -d "${ct_backup_path}" ]; then
mkdir -p -- "${ct_backup_path}"
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Backup data — ${ct_backup_path} was created."
fi
## Backup container data
tar czf "${ct_backup_path}/${ct_name}-backup.$(date '+%Y%m%d-%H%M').tar.gz" --directory "${docker_data_path}" "${ct_name}"
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Backup data — Data of ${ct_name} container were successfully backuped ${ct_backup_path}/${ct_name}-backup.$(date '+%Y%m%d-%H%M').tar.gz"
# }}}
exit 0