On Sun, Aug 14, 2022, at 5:08 PM, Bill Cunningham wrote:
> I just thought I would ask for opinions on backups that people use. 
> I have thought about the old fashioned dump/restore; IDK if that would 
> be good for modern use or not. My system isn't really that big. My 
> allotted size is 30 Gig, and it's not full. There's dar and xar and 
> fsarchiver. There's backing up with btrfs too.

I mainly backup just /home because I consider everything else replaceable. So 
for that it's

# mount /dev/nvme0n1p5 /mnt       ##mount top-level of btrfs
# cd /mnt
# btrfs sub snap -r home home.20220815
$ sudo btrfs send -p home.20220810 home.20220815 | ssh chris@fnuc.local "sudo 
btrfs receive /srv/backups/fovo/"

That's it. Incremental backup using btrfs send/receive over ssh, where 
/srv/backups/fovo is also btrfs. These are quite cheap because no deep 
traversal is required on either side. Btrfs keeps a generation number on each 
file, so it's cheap for it to locate files that differ. This cheapness also 
applies to rename and moving files, if you move a big file, most other methods 
require delete in one location and copy to another location, whereas btrfs sees 
that it's moved on the source and merely moves it on the destination.

Ok that's not entirely it. There is clean up. You can keep them around as long 
as you want with no ill impact, but when you decide to clean up, you can remove 
all the snapshots except the most recently sent, i.e. you want a common 
snapshot on the local and remote systems, in order to preserve the ability to 
do an incremental send/receive. The same goes for the remote - you can keep 
those indefinitely, limited only by space available. Or clean them up leaving 
just one in common with send and receive sides.

>
>      I am thinking about back ups of the whole system and rpms I have 
> installed. And maybe not backing up logs, old settings like are stored 
> in the root directory of the user(s) and root account.

You could also employ the same technique above to the "root" subvolume. But 
it'll include logs unless you split that out with a separate subvolume in the 
top-level along side root and home subvolumes, and add to fstab so it mounts at 
/var/log

I really don't often backup / though. What I do tend to do semi-often is 
replicate a root between systems, virtual and real. The part I like about 
send/receive here, even though it's not any faster than rsync or even cp -a, is 
that everything is preserved: permissions, owner, selinux labels, all of the 
time stamps (otime, atime, mtime, ctime); I just don't have to think about it.

I could use btrbk to help automate all of this, but what can I say, I'm a bit 
lazy and I'd have to think about it a little bit.

It really is cheap enough you could kick off a backup every 10 minutes if you 
want. It'd take a couple seconds for it to figure out what's changed and 
whether the parent snapshot is already on the destination. And then it's just 
the time to transfer the data that's changed. So for a single file changed in 
10 minutes, it could take just a couple seconds.




-- 
Chris Murphy
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to