WIP: Check if directories exists
This commit is contained in:
parent
72b4db9a20
commit
5e66b3f93c
|
@ -3,7 +3,7 @@
|
||||||
# Purpose {{{
|
# Purpose {{{
|
||||||
## Backup data of a Docker container.
|
## Backup data of a Docker container.
|
||||||
## To do that, the script will :
|
## To do that, the script will :
|
||||||
## Stop the corresponding container (or docker if no related service is found)
|
## Try to stop the corresponding container (or docker if no related service is found)
|
||||||
## Make a archive of the container's data to a backup path
|
## Make a archive of the container's data to a backup path
|
||||||
## Clean old backup
|
## Clean old backup
|
||||||
## Restart the container service (or docker.service)
|
## Restart the container service (or docker.service)
|
||||||
|
@ -60,6 +60,24 @@ esac
|
||||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Args management — Path to store the backup : ${docker_backup_path} ."
|
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Args management — Path to store the backup : ${docker_backup_path} ."
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
## Ensure Docker data directory exists {{{
|
||||||
|
if [ ! -d "${docker_data_path}" ]; then
|
||||||
|
printf '\e[0;31m%-6s\e[m\n' "Docker data directory doesn't seems available : ${docker_data_path} ."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
## }}}
|
||||||
|
## Ensure backup directory exists {{{
|
||||||
|
if [ ! -d "${docker_backup_path}" ]; then
|
||||||
|
printf '\e[0;31m%-6s\e[m\n' "Backup directory doesn't seems available : ${docker_backup_path} ."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
## }}}
|
||||||
|
## Ensure container data directory exists {{{
|
||||||
|
if [ ! -d "${docker_data_path}/${ct_name}" ]; then
|
||||||
|
printf '\e[0;31m%-6s\e[m\n' "Container directory doesn't seems available : ${docker_data_path}/${ct_name} ."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
## }}}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue