aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2017-05-22 18:35:03 -0400
committerB Stack <bgstack15@gmail.com>2017-05-22 18:35:03 -0400
commit5c09c3da7ef95d16d5c9b52a133af712a4eb4a9f (patch)
tree89b528f16489ca2a0e3408d04ebdb448251c4685
parentdeleted rbup.sh backups (diff)
downloadrbup-5c09c3da7ef95d16d5c9b52a133af712a4eb4a9f.tar.gz
rbup-5c09c3da7ef95d16d5c9b52a133af712a4eb4a9f.tar.bz2
rbup-5c09c3da7ef95d16d5c9b52a133af712a4eb4a9f.zip
added RBUP_MOUNT_POINT; also some extra debugging
-rw-r--r--etc/rbup/rbup.conf3
-rw-r--r--etc/rbup/storage1.conf6
-rwxr-xr-xusr/share/rbup/rbup.sh19
3 files changed, 25 insertions, 3 deletions
diff --git a/etc/rbup/rbup.conf b/etc/rbup/rbup.conf
index fd34bb0..e2406f5 100644
--- a/etc/rbup/rbup.conf
+++ b/etc/rbup/rbup.conf
@@ -45,6 +45,9 @@ RBUP_VERBOSE=yes
#RBUP_DEST_MOUNT_CMD="mount nas1:/volume1/share /mnt/nas1/"
#RBUP_DEST_UMOUNT_CMD="umount -l /mnt/nas1/"
+# RBUP_MOUNT_POINT: where to check to confirm mount finished
+#RBUP_MOUNT_POINT=/mnt/nas1/
+
# RBUP_DEST: destination of the sync
#RBUP_DEST=/mnt/nas1/
diff --git a/etc/rbup/storage1.conf b/etc/rbup/storage1.conf
index 6ab1902..be0b169 100644
--- a/etc/rbup/storage1.conf
+++ b/etc/rbup/storage1.conf
@@ -21,8 +21,10 @@ RBUP_SYNC_OPT_VERBOSE="-v"
RBUP_SYNC_OPT_NOT_VERBOSE=""
RBUP_SYNC_OPT_APPLY=""
RBUP_SYNC_OPT_NOT_APPLY="-n"
-RBUP_DEST_MOUNT_CMD="mount jonathan:/volume1/sword /mnt/jonathan/"
-RBUP_DEST_UMOUNT_CMD="umount -l /mnt/jonathan/"
+RBUP_DEST_MOUNT_CMD="mount jonathan:/volume1/sword /mnt/jonathan"
+RBUP_DEST_UMOUNT_CMD="umount -l /mnt/jonathan"
+RBUP_MOUNT_POINT=/mnt/jonathan
+
RBUP_DEST=/mnt/jonathan
RBUP_LOG_DIR=/var/log/rbup
diff --git a/usr/share/rbup/rbup.sh b/usr/share/rbup/rbup.sh
index b0ad329..3717ca3 100755
--- a/usr/share/rbup/rbup.sh
+++ b/usr/share/rbup/rbup.sh
@@ -246,16 +246,33 @@ fi
${RBUP_DEST_MOUNT_CMD} && debuglev 2 && ferror "Mount successful."
fi
+ # Ensure mount is mounted
+ if test -n "${RBUP_MOUNT_POINT}";
+ then
+ if mount | grep -q -- "${RBUP_MOUNT_POINT}";
+ then
+ :
+ else
+ ferror "ERROR 8. Failed to mount: ${RBUP_MOUNT_POINT}."
+ ferror "Aborted."
+ exit 8
+ fi
+ fi
+
# Determine apply and verbose states
applystate="${RBUP_SYNC_OPT_NOT_APPLY}"
verbosestate="${RBUP_SYNC_OPT_NOT_VERBOSE}"
fistruthy "${RBUP_ENABLED}" && applystate="${RBUP_SYNC_OPT_APPLY}"
fistruthy "${RBUP_VERBOSE}" && verbosestate="${RBUP_SYNC_OPT_VERBOSE}"
+ # Prepare full command
fullcommand="$( echo "${RBUP_SYNC_CMD} ${RBUP_SYNC_OPTS} ${applystate} ${verbosestate} ${RBUP_SOURCE} ${RBUP_DEST}" | sed -r -e 's/[[:space:]]+/ /g;' )"
# Run sync
- debuglev 1 && ferror "${fullcommand}"
+ debuglev 1 && {
+ ferror "Executing:"
+ ferror "${fullcommand}"
+ }
${fullcommand}
# Unmount destination
bgstack15