diff --git a/README.md b/README.md index 7754947..1f2d0d5 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ Execute: ./docker-volume-backup.sh ``` -Optional a directory for the backup folder can be defined: +Optional a user for the backup can be defined: ```bash -./docker-volume-backup.sh /tmp +./docker-volume-backup.sh administrator ``` ## Test diff --git a/docker-volume-backup.sh b/docker-volume-backup.sh index 4dc6e37..5b34f32 100644 --- a/docker-volume-backup.sh +++ b/docker-volume-backup.sh @@ -1,11 +1,11 @@ #!/bin/bash # @todo rethink optional parameter -# @param $1 [optional] : The path for the backups folder. DEFAULT $HOME/Backups/ +# @param $1 [optional] : The user for the backups # @see https://www.freedesktop.org/software/systemd/man/machine-id.html backup_time="$(date '+%Y%m%d%H%M%S')" -docker_backups_mount="$(test -z "$1" && echo "/Backups/" || echo "/$(basename "$1")/")" -native_backups_mount_prefix="$(test -z "$1" && echo "$HOME" || echo "/$(dirname "$1")/")" +docker_backups_mount="/Backups/" +native_backups_mount_prefix="$(test -z "$1" && echo "$HOME" || echo "/home/$1")" native_backups_mount="$native_backups_mount_prefix$docker_backups_mount" for docker_container_name in $(docker ps --format '{{.Names}}'); do