Skip to content

Commit 826e502

Browse files
Improve helper text and documentation for -d parameter.
1 parent a9699ab commit 826e502

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ By default, the script searches the following locations for a partition to use a
9595
1. The first partition labeled `pve_backup_usb` listed under `/dev/disk/by-label/`.
9696
2. The first partition on the first USB disk found via `/dev/disk/by-path/`.
9797

98-
No need to worry: existing partitions or drives not [intended](#preparation-of-an-external-usb-drive) for backups will not be destroyed, as decryption will simply fail, and the script will stop. If this automated behavior does not match your environment, you can provide a custom list of disk labels or UUIDs to search before the default locations are checked (cf. `-d` parameter).
98+
No need to worry: existing partitions or drives not [intended](#preparation-of-an-external-usb-drive) for backups will not be destroyed, as decryption will simply fail, and the script will stop. If this automated behavior does not match your environment, you can provide a custom list of partition labels or UUIDs to search before the default locations are checked (cf. `-d` parameter).
9999

100100

101101
### Parameters
@@ -116,7 +116,7 @@ No need to worry: existing partitions or drives not [intended](#preparation-of-a
116116

117117
**Miscellaneous, optional**
118118

119-
* `-d`: A UUID of the target partition to decrypt. Will be used to search it in `/dev/disk/by-uuid/` (you might use `blkid /dev/sdX1` to determine the UUID). By default, the script is simply using the first partition on the first USB disk it is able to find via `/dev/disk/by-path/`. No worries: existing drives not used for backups won't be destroyed as the decryption will fail. But this automatism presumes that only one USB disk is connected during the script run. Defining a UUID will work if there are more than one (e.g. when it is not feasible in your environment to just have one disk connected simultaneously).
119+
* `-d`: List of partition labels or UUIDs to search before the default locations are checked for the backup target partion. By default, the script searches the following locations for a partition to use as the backup target for decryption and mounting:<br>1. The first partition labeled `pve_backup_usb` listed under `/dev/disk/by-label/`.<br>2. The first partition on the first USB disk found via `/dev/disk/by-path/`.<br>If this automated behavior does not match your environment, you can provide a custom list of partition labels or UUIDs to search before using this parameter. Separate multiple targets with commas (CSV format). Any given UUID will be searched under `/dev/disk/by-uuid/` (you might use `blkid /dev/sdX1` to determine a UUID), while any other string matching the pattern `^[0-9a-zA-Z_ \-]{1,16}$` will be searched under `/dev/disk/by-label/`. The search will be performed in the exact order the items appear in the list.<br>No need to worry: existing partitions or drives not [intended](#preparation-of-an-external-usb-drive) for backups will not be destroyed, as decryption will simply fail, and the script will stop.
120120
* `-h`: Flag to print help.
121121
* `-j`: Flag to enable the continuation of the backup process in case of an error during the copying and/or verification of files. If this flag is not set, the script will immediately halt the entire backup process and display an error if any file to be backed up cannot be copied (or verified, cf. `-c`). If the flag is set, the backup will continue with the remaining files to be backed up (if any). Activating this feature requires careful review of the backup logs and emails/messages, as a quick inspection of the backup media might incorrectly suggest that all PVE sources were successfully backed up, even though some files may be missing or damaged. However, this allows for the possibility that at least some partially useful backup data will be available.
122122
* `-k`: Path to a keyfile containing a passphrase to unlock the target device. Defaults to `/etc/credentials/luks/pve_backup_usb`. There must be no other chars beside the passphrase, including no trailing new line or [`EOF`](https://en.wikipedia.org/wiki/End-of-file). You might use `perl -pi -e 'chomp if eof' /etc/credentials/luks/pve_backup_usb` to get rid of an invisible, unwanted `EOF`.

pve_backup_usb.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,21 @@ Enable checksum creation and verification of the copies (recommended for
210210
safety but probably doubles the time needed for completing the backup task).
211211
.TP
212212
.B -d
213-
By default, the script searches the following locations for a partition to use
214-
as the backup target for decryption and mounting:
213+
List of partition labels or UUIDs to search before the default locations are
214+
checked for the backup target partion. By default, the script searches the
215+
following locations for a partition to use as the backup target for decryption
216+
and mounting:
215217
1. The first partition labeled "pve_backup_usb" listed under /dev/disk/by-label/.
216218
2. The first partition on the first USB disk found via /dev/disk/by-path/.
217-
No need to worry: existing partitions or drives not intended for backups will
218-
not be destroyed, as decryption will simply fail, and the script will stop.
219219
If this automated behavior does not match your environment, you can provide a
220-
custom list of disk labels or UUIDs to search before the default locations are
221-
checked. Separate multiple targets with commas (CSV format). Any given UUID
222-
will be searched under /dev/disk/by-uuid/, while any other string matching the
223-
pattern "^[0-9a-zA-Z_ \-]{1,16}$" will be searched under /dev/disk/by-label/.
220+
custom list of partition labels or UUIDs to search before using this parameter.
221+
Separate multiple targets with commas (CSV format). Any given UUID will be
222+
searched under /dev/disk/by-uuid/ (you might use "blkid /dev/sdX1" to determine
223+
a UUID), while any other string matching the pattern "^[0-9a-zA-Z_ \-]{1,16}$"
224+
will be searched under /dev/disk/by-label/. The search will be performed in the
225+
exact order the items appear in the list. No need to worry: existing partitions
226+
or drives not intended for backups will not be destroyed, as decryption will
227+
simply fail, and the script will stop.
224228
.TP
225229
.B -e
226230
Email address to send notifications to. Format: '[email protected]'.

0 commit comments

Comments
 (0)