You are not logged in.

#1 2019-04-15 15:23:07

olocin
Member
Registered: 2018-01-03
Posts: 171

good backup practice with rsync

Following the wiki, I take a back-up (snapshot) of my home folder into an external hard drive using rsync and the following options:

rsync -P -a --delete --exclude={"/home/olocin/.cache/mozilla/*","/home/olocin/.cache/chromium/*","/home/olocin/.local/share/Trash/*"} /home/olocin/. full-home

Am I making any stupid mistake, or is there a quicker way?
(Last time, it took around 1h to update 450 MB of new files and update a few ones, home size being 250 GB.)
The purpose of the backup is recovery, say after the laptop is lost or its drive erased for a fresh install.

Offline

#2 2019-04-15 19:04:02

romstor
Member
Registered: 2018-08-18
Posts: 54

Re: good backup practice with rsync

rsync options is a big topic. Nothing controversial about the command above. What is your question about specifically? rsync will be much quicker second time around. The idea is to run the same command and it will only copy the delta. You also may want to encrypt your portable hard drive and create, validate and store md5sum if you are worried about the quality of the hard drive. Here is some more info Linux Crypto: Disks, Arch Wiki - dm-crypt.

If you copy files to a locally mounted drive and not over the network and copy speed is of concern you can check tools like this one: A fast and reliable alternative to rsync for synchronizing local files written in Rust (sorry, no pacman or AUR, but rust is in Arch repos and cargo does _everything_ automatically, so you can follow the build instructions). Remember that rsync is more battle-tested and reliable, but if you just mirror copy files - md5sum tool will give you an immediate warning if something gets corrupted during copy or in case of a bad disk.

Last edited by romstor (2019-04-15 19:14:43)

Offline

#3 2019-04-15 20:05:13

olocin
Member
Registered: 2018-01-03
Posts: 171

Re: good backup practice with rsync

Thanks.
Hard drive is encrypted, and I'm copying locally.
I guess I just wanted to make sure I'm not doing anything stupid, or at least very stupid.

Offline

#4 2019-04-21 19:50:26

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: good backup practice with rsync

You could also consider using incremental backups using rsync with hard links if you have sufficient storage space - you can create dated folders which gives you the chance to get multiple versions of the same file from different dates.
Just using your command from above will overwrite files each time you run it, which maybe fine for what you need - you could also create dated versions of files for important files if needed.

Cheers
Paul.

Offline

#5 2019-04-21 20:04:06

olocin
Member
Registered: 2018-01-03
Posts: 171

Re: good backup practice with rsync

Good to know, thanks.

Offline

#6 2019-04-30 14:16:48

olocin
Member
Registered: 2018-01-03
Posts: 171

Re: good backup practice with rsync

It only took a few seconds the second time, as you predicted.

Offline

#7 2019-05-07 16:35:47

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: good backup practice with rsync

Offline

Board footer

Powered by FluxBB