chiark / gitweb /
rsync-backup.in, rsync-backup.8: Ensure the store filesystem is mounted.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 8 Oct 2012 08:12:23 +0000 (09:12 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 8 Oct 2012 08:12:23 +0000 (09:12 +0100)
Previously this was left as the responsibility of some wrapper script,
but that's really annoying, and we should do it ourselves.

rsync-backup.8
rsync-backup.in

index a32c65653f3435a72856554b7268d0ed380325ea..a265352ced5ebf5c1f3c36ea754784a0ced56d9b 100644 (file)
@@ -364,6 +364,10 @@ Backup trees are stored in a fairly straightforward directory tree.
 At the top level is one directory for each client host.  There are also
 some special entries:
 .TP
 At the top level is one directory for each client host.  There are also
 some special entries:
 .TP
+.B \&.rsync-backup-store
+This file must be present in order to indicate that a backup volume is
+present (and not just an empty mount point).
+.TP
 .B fshash.cache
 The cache database used for improving performance of local file
 hashing.  There may be other
 .B fshash.cache
 The cache database used for improving performance of local file
 hashing.  There may be other
index 5c9a54cefff2570bd87ba48b8cebb010202e2390..705696d2b8cb4f73461c9f8aa288177d48c84d8c 100644 (file)
@@ -606,6 +606,15 @@ backup () {
   ## Back up the filesystems on the currently selected host using the
   ## currently selected snapshot type.
 
   ## Back up the filesystems on the currently selected host using the
   ## currently selected snapshot type.
 
+  ## Make sure that there's a store volume.  We must do this here rather than
+  ## in the main body of the script, since the configuration file needs a
+  ## chance to override STOREDIR.
+  if ! [ -r $STOREDIR/.rsync-backup-store ]; then
+    echo >&2 "$quis: no backup volume mounted"
+    exit 15
+  fi
+
+  ## Back up each requested file system in turn.
   for fs in "$@"; do
 
     ## Parse the argument.
   for fs in "$@"; do
 
     ## Parse the argument.