chiark / gitweb /
Enable plain devices in rsbackup-mount
authorMatthew Vernon <matthew.vernon@sac.ac.uk>
Fri, 16 Nov 2012 16:46:25 +0000 (16:46 +0000)
committerRichard Kettlewell <rjk@terraraq.org.uk>
Fri, 16 Nov 2012 21:18:12 +0000 (21:18 +0000)
If you set DEVICE_plain in rsbackup/devices, then rsbackup-mount simply
mounts the relevant device rather than trying to cryptsetup it.

This patch documents the new syntax in the manual and the example
rsbackup.devices file.

Signed-off-by: Matthew Vernon <matthew@debian.org>

doc/rsbackup-mount.1
tools/rsbackup-mount.in
tools/rsbackup.devices

index bc7e81b..50f8d74 100644 (file)
@@ -1,11 +1,11 @@
 .TH rsbackup-mount 1
 .SH NAME
-rsbackup-mount \- mount encrypted disks used by rsbackup
+rsbackup-mount \- mount encrypted or unencrypted disks used by rsbackup
 .SH SYNOPSIS
 \fBrsbackup-mount\fR [\fIOPTIONS\fR] [\fB\-\-\fR] [\fIDEVICES\fR]
 .SH DESCRIPTION
-\fBrsbackup-mount\fR mounts and unmounts encrypted partitions used as
-backup stores by \fBrsbackup\fR(1).
+\fBrsbackup-mount\fR mounts and unmounts encrypted or unencrypted
+partitions used as backup stores by \fBrsbackup\fR(1).
 .SH OPTIONS
 .TP
 .B \-\-unmount\fR, \fB\-u
@@ -28,7 +28,9 @@ Configuration is read from \fI/etc/rsbackup/devices\fR.
 This is a shell script fragment.
 It should set \fBdevices\fR to a (space-separated) list of device
 names and for each device name \fID\fR, define \fID\fR\fB_uuid\fR to
-its UUID.
+its UUID. To specify that a device is unencrypted (i.e. that it just
+requires mounting or unmounting), define \fID\fR\fB_plain\fR as a
+non-empty string for that device.
 (Have a look in \fI/dev/disk/by-uuid\fR to find device UUIDs).
 .SS Example
 .nf
@@ -39,6 +41,10 @@ devices="backup3 backup4"
 # e.g. devicename_uuid=8f4171f0-007d-4083-a40c-407e5f9c24dd
 backup3_uuid=8f4171f0-007d-4083-a40c-407e5f9c24dd
 backup4_uuid=80a1ca0d-d07a-4195-9da1-8cbb9fbc11b9
+
+# For any device that isn't encrypted, define DEVICE_plain
+# e.g. devicename_plain=1
+backup3_plain=1
 .fi
 .SH "SEE ALSO"
 \fBrsbackup\fR(1), \fBrsbackup.cron\fR(1)
index 18231e3..50a8807 100755 (executable)
@@ -76,7 +76,8 @@ fi
 case $action in
 mount )
   for device; do
-    if [ ! -e /dev/mapper/$device ]; then
+    plain=$(eval echo \$${device}_plain)
+    if [ ! -e /dev/mapper/$device -a -z "$plain" ]; then
       uuid=$(eval echo \$${device}_uuid)
       ls -l /dev/disk/by-uuid/$uuid
       if [ -n "$keyfile" ]; then
index c5bed21..56a1b01 100644 (file)
@@ -4,3 +4,5 @@ devices=""
 # For each device, define DEVICE_uuid
 # e.g. devicename_uuid=8f4171f0-007d-4083-a40c-407e5f9c24dd
 
+# For any device that isn't encrypted, define DEVICE_plain
+# e.g. devicename_plain=1