mirror of
https://github.com/napnap75/multiarch-docker-images.git
synced 2025-12-16 03:34:18 +01:00
Added a check not to backup the root directory
This commit is contained in:
@@ -3,7 +3,10 @@
|
|||||||
# Backup one directory
|
# Backup one directory
|
||||||
function backup_dir {
|
function backup_dir {
|
||||||
# Check if the dir to backup is mounted as a subdirectory of /root inside this container
|
# Check if the dir to backup is mounted as a subdirectory of /root inside this container
|
||||||
if [ -d "/root_fs$1" ]; then
|
if [ "$1" = "" ]; then
|
||||||
|
echo "[ERROR] Cannot backup the root directory. Have you correctly configured the volumes to backup for this container ?"
|
||||||
|
return -1
|
||||||
|
elif [ -d "/root_fs$1" ]; then
|
||||||
restic backup $RESTIC_BACKUP_FLAGS /root_fs$1
|
restic backup $RESTIC_BACKUP_FLAGS /root_fs$1
|
||||||
return $?
|
return $?
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user