WIP: Add debug messages
This commit is contained in:
parent
9c88629696
commit
3ad60f6f39
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue