aboutsummaryrefslogtreecommitdiffstats
path: root/stromboli_backup
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2018-04-04 20:55:01 +0200
committerEduardo Pedroni <e.pedroni91@gmail.com>2018-04-04 20:55:01 +0200
commit1952f586f09edf4ad1be4ddeef01e190ae152931 (patch)
tree7a0955c94504661363e77e14fd8c8cb86b7b026f /stromboli_backup
parent3ee260ee67ee6e17f583c9cc0ac8f7e37c1ae190 (diff)
Made stromboli script more robust in case the NFS mount fails
Diffstat (limited to 'stromboli_backup')
-rwxr-xr-xstromboli_backup9
1 files changed, 9 insertions, 0 deletions
diff --git a/stromboli_backup b/stromboli_backup
index 4263065..190e7d3 100755
--- a/stromboli_backup
+++ b/stromboli_backup
@@ -2,6 +2,15 @@
# Backup script for stromboli. This synchronises stromboli's local storage with the NFS data from vesuvio. Since this script mounts and umounts the NFS, it should be configured to be mountable without root on fstab.
mount /home/eddy/data
+
+if [ $? -ne 0 ]; then
+ # mount failed, better exit so that we don't wipe the existing backup
+ # TODO send some kind of failure notification
+ exit 1
+fi
+
/home/eddy/bin/backup /home/eddy/data /home/eddy/backup
+
sync
+
umount /home/eddy/data