[ALUG] RPi SD backup/restore

Nev Young alug at nevilley.org.uk
Sun Sep 24 10:06:00 BST 2017

On 22/09/17 13:38, Mark Rogers wrote:
> On 22 September 2017 at 13:08, Chris Green <cl at isbd.net> wrote:
>> As a general rule for myself I do my very best not to customise things
>> too much and to keep installations as standard as possible.  Thus all
>> my installations, as far as possible, only have differences from 'as
>> installed' in /etc and /home so I just back those up.
> Ditto, although increasingly I'm starting to use /opt as well.
> One thing I like about my tar-based backup is that in principle I can
> add additional "incremental" [*] tarballs to the base quite easily. So
> I can, for example, take a current Raspbian, apt upgrade it to get
> latest packages (and maybe a standard set of non-default packages I
> use), then back it up as a snapshot. I can then take my "application"
> code and include that in the backup so that it gets restored over the
> top and ends up with a finished system, but in a way which is
> more-or-less trivial to manage the OS updates separately from the
> application.
> [*] It's not a true incremental backup as it would only replace or add
> files, not delete them. But it's close enough for my purposes, and I'm
> sure the extra deletion step could be brought in if needed.
I'm a bit late to the discussion but my set-up may help.

Skip the next 4 lines if you can install the SD card on your backup machine.
I have several PIs on the network and back these up weekly using the command
rsync -varlHpEu --del  /bin /etc /home /lib /root /sbin /tmp /usr /var 
$deadalus2:/$webpi-backup/root | grep -v '/$'
where $deadalus2 is the ip address of the backup machine and 
$webpi-backup is the path to the backup.
When run, from the PI, it updates the backup files incrementally to give 
a current snapshot.  The first run takes a long time!

I then use "Back In Time" as root to create a current snapshot to the 
backup usb-drive. Each week the backup appears as a complete snapshot 
but in fact most of the files are simply hard links to the previous 
backup saving space and time.

If you can not find Back In Time in your distribution repository you can 
download it from https://github.com/bit-team/backintime

Hope that makes sense.



More information about the main mailing list