diff options
author | Erich Eckner <git@eckner.net> | 2019-01-21 09:10:25 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-01-21 09:11:43 +0100 |
commit | 42ba782994b2dc269987160055a019c47e7c29f4 (patch) | |
tree | 8568464d3ef0817fef47041a1bdb16ef5c7747fb | |
parent | cfb15ec7f710ce339e0be988291b88ae5dcfa0d9 (diff) | |
download | hardlinkedBackups-42ba782994b2dc269987160055a019c47e7c29f4.tar.xz |
make needed mounts configurable
-rw-r--r-- | backup.conf | 3 | ||||
-rwxr-xr-x | backup.in | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/backup.conf b/backup.conf index 9cc3753..6043fb3 100644 --- a/backup.conf +++ b/backup.conf @@ -14,6 +14,9 @@ declare -A backups backups["directBackup"]="/path/to/destination/ user@source:path" backups["proxiedBackup"]="/path/to/destination/ user@source:path proxy_user@ssh_host" +# which directories must be mounted before we can run successfully +neededMounts=('/data') + # how long to wait for destination directories to appear in lastBackups [seconds] maxWait=100 @@ -76,7 +76,11 @@ if [ -n "${HoppIP}" ]; then fi if [ ! -d ${Basis} ]; then - [ $(mount | grep -c "\S\+\s\+\S\+\s\+/var/ftp\s") -eq 0 ] && exit 11 + for neededMount in "${neededMounts[@]}"; do + if ! mountpoint -q "${neededMount}"; then + exit 11 + fi + done exit 2 fi |