Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] disaster recovery - planning
Date: Tue, 21 Mar 2017 00:58:46
Message-Id: CAGfcS_mqwzwFWmyx_KirvNFzJvoH1ec=CiyZqNWmjGVzGh3NWA@mail.gmail.com
In Reply to: [gentoo-user] disaster recovery - planning by thelma@sys-concept.com
1 On Mon, Mar 20, 2017 at 7:15 PM, <thelma@×××××××××××.com> wrote:
2 > Besides standard "data" backup, if I was to plan for a disaster
3 > recovery; what to include in a backup system if I was to rebuild a new box?
4 >
5 > - /etc
6 > - /var/lib/portage/world
7 > - /usr/src/linux/.config
8 > - /var/spool/fax/ (if needed)
9 > - /var/www/localhost/htdocs/ (if needed)
10 > - crontab (users and root)
11 >
12
13 Here is what I'm backing up to the cloud via duplicity (where storage
14 is expensive so I have a more selective set of rules here):
15 --include /boot --include /usercache --include /etc --include
16 /data/www --include /data/home --include /root --include
17 /var/lib/samba --include /var/spool/tftp --include /var/lib/cdcat
18 --include /var/bind --include /usr/local --include
19 /var/lib/portage/world --include /data/diskless/gentooinst64 --include
20 /data/diskless/mythliv2 --include /var/lib/bitcoin/.bitcoin/wallet.dat
21 --include /var/lib/quassel/ --include /var/lib/ --include
22 /data/sstorage3/containers/mariadb/ --include
23 /data/sstorage3/containers/vpn/ --include
24 /data/sstorage3/containers/ddclient/ --include
25 /data/sstorage3/containers/dns/
26
27 (I realize that a lot of this references mountpoints that are useless
28 to you, but the end of the paths is probably good enough as a
29 checklist. Yes, I realize a few of those are redundant, but I suspect
30 they might get around exclusions.)
31
32 My excludes for these more expensive backups contain things like:
33 www cache directories for some apps
34 Trash directories
35 NNTP client caches
36 Download directories
37 ~/.cache
38 mail client caches (I use IMAP)
39 bitcoin blockchains
40 mysql data directory (I separately run mysqldump and back that up)
41 .snapshots on volumes that use zfs/btrfs
42 /usr and /var/log on my containers
43 Any random /tmp that would otherwise be caught
44
45 In general I try to stick stuff I want to back up in /home, and stick
46 stuff I don't want to backup elsewhere and just symlink it into /home
47 where needed. The include/excludes just handle the random stuff where
48 this policy isn't practical.
49
50 Now, I also keep local backups of everything and the rules are much
51 more inclusive there. I just exclude things like /sys, /proc,
52 anything with a bind mount (so as to not save it twice), /usr/portage
53 (changes constantly, trivial to restore), all those .snapshots
54 directories, and the same sorts of things in chroots (but not
55 containers).
56
57 As far as the suggestion to use ansible/etc goes for things like /etc
58 - I certainly agree it is a best practice.
59
60 --
61 Rich