#1165 PR merged: Align backup on USB with backup on NFS

Labels: enhancement, documentation, cleanup, fixed / solved / done

jsmeix opened issue at 2017-01-13 10:43:

The new config variable USB_SUFFIX
specifies the last part of the backup directory on the USB medium.
When USB_SUFFIX is unset or empty, backup on USB works
in its current default mode (i.e. backward compatible)
which means multiple timestamp backup directories
plus automated rescue environments and backups cleanup
via USB_RETAIN_BACKUP_NR.
When USB_SUFFIX is set, backup on USB works
in compliance with how backup on NFS works
which means a fixed backup directory and
no automated removal of any stuff
(regardless of USB_RETAIN_BACKUP_NR).
When backup on USB behaves as backup on NFS
(i.e. when USB_SUFFIX is set) multiple backups and
incremental/differential backups also work on USB.
See
https://github.com/rear/rear/issues/1164
https://github.com/rear/rear/issues/1160
https://github.com/rear/rear/issues/1145

jsmeix commented at 2017-01-13 11:22:

For me incremental backups "just work" now with

OUTPUT=USB
USB_DEVICE=/dev/disk/by-label/REAR-000
USB_SUFFIX="myincrementalbackups"
BACKUP=NETFS
BACKUP_URL=usb:///dev/disk/by-label/REAR-000
BACKUP_TYPE=incremental
FULLBACKUP_OUTDATED_DAYS=7
FULLBACKUPDAY=Wed

jsmeix commented at 2017-01-13 14:00:

The default behaviour still works for me with

OUTPUT=USB
USB_DEVICE=/dev/disk/by-label/REAR-000
BACKUP=NETFS
BACKUP_URL=usb:///dev/disk/by-label/REAR-000

After 5 times "rear mkbackup" I get on the REAR-000 medium
(with the default USB_RETAIN_BACKUP_NR=2)
the latest (current) rescue environment or backup plus
the second eldest and the third eldest (three all together):

rear/e205/20170113.1422
rear/e205/20170113.1422/kernel
rear/e205/20170113.1422/rear-e205.log
rear/e205/20170113.1422/syslinux.cfg
rear/e205/20170113.1422/backup.log
rear/e205/20170113.1422/initrd.cgz
rear/e205/20170113.1422/backup.tar.gz
rear/e205/20170113.1429
rear/e205/20170113.1429/kernel
rear/e205/20170113.1429/rear-e205.log
rear/e205/20170113.1429/syslinux.cfg
rear/e205/20170113.1429/backup.log
rear/e205/20170113.1429/initrd.cgz
rear/e205/20170113.1429/backup.tar.gz
rear/e205/20170113.1442
rear/e205/20170113.1442/kernel
rear/e205/20170113.1442/rear-e205.log
rear/e205/20170113.1442/syslinux.cfg
rear/e205/20170113.1442/backup.log
rear/e205/20170113.1442/initrd.cgz
rear/e205/20170113.1442/backup.tar.gz

As everything looks o.k. for me I will merge it.

gozora commented at 2017-01-13 14:53:

@jsmeix
Yesterday I've spent several hours to make this somehow work with BLOCKCLONE!
Next time I'll write documentation instead :-).

jsmeix commented at 2017-01-13 15:04:

@gozora
I appreciate your patient testing very much.
I hope with current GitHub master code
things work more as usual elsewhere also with USB
provided USB_SUFFIX is specified which BTW also
avoids things like https://github.com/rear/rear/issues/1166

I get more and more the uncomfortable feeling that
I may need to rework the whole backup on USB stuff
just as it happened to me with incremental backups :-(

gozora commented at 2017-01-15 20:08:

@jsmeix

I just finished some testing of BLOCKCONE on USB. I can confirm that USB_SUFFIX works well!

V.

jsmeix commented at 2017-01-16 09:43:

@gozora
many thanks for your positive feedback.
It is much appreciated!
Last week I was a bit frustrated because
I had seen some bits of too ugly code cf. "FIXME" in
https://github.com/rear/rear/pull/1165/commits/a603b460625a5360e69a360192455c0d86c41434
(cf. http://tldp.org/LDP/abs/html/gotchas.html)
that obscured my mind so that I got confused
also about the "backuparchive" usage cf.
https://github.com/rear/rear/issues/1166#issuecomment-272468726
but the "backuparchive" usage and implementation is actually o.k.
only that the variable name should be uppercase.


[Export of Github issue for rear/rear.]