1 |
On Tue, Mar 7, 2017 at 12:04 AM, <thelma@×××××××××××.com> wrote: |
2 |
> I was looking at this rotating backup script |
3 |
> |
4 |
> source: |
5 |
> https://community.spiceworks.com/topic/34970-how-to-create-rotating-backups-of-files |
6 |
> |
7 |
|
8 |
If you're looking for rotating backup solution based on rsync I'd take |
9 |
a look at rsnapshot. It is in the Gentoo repo, and it has been |
10 |
completely dependable in my experience. |
11 |
|
12 |
You get the same kind of storage you'd expect with plain rsync (just a |
13 |
replica directory tree that you can freely read, cp from, etc). |
14 |
However, it does stuff like ensure backups are complete before |
15 |
rotating them in, handling the rotation itself, and also linking |
16 |
incremental backups with hard-links to reduce storage. It isn't quite |
17 |
de-duplication but it gets you 90% of the benefit vs having a bunch of |
18 |
complete backup directories that each take up the capacity of a full |
19 |
backup. Basically it copies the last backup using hard links, then |
20 |
rsyncs over that. The result is what looks like a bunch of full |
21 |
backups but without all the space use. |
22 |
|
23 |
If you're looking for something even more space-efficient that is |
24 |
still based on rsync but which does not store its files as a simple |
25 |
replica directory tree then look at duplicity, which is also in the |
26 |
Gentoo repo. It stores the data in compact archive files like most |
27 |
other backup solutions, but it uses librsync to do most of the heavy |
28 |
lifting. If 1kb changes inside the middle of a 1TB file it only |
29 |
stores the extra 1kb, just as rsync would only transfer the 1kb. It |
30 |
also has a bunch of backend options, including a few cloud services |
31 |
like S3. For remote backups it is pretty smart about how it stores |
32 |
metadata vs data so that if the local cache gets out of sync it can |
33 |
just re-fetch the metadata from the cloud without having to retrieve |
34 |
the actual backup data, and it supports gpg. |
35 |
|
36 |
I personally use both right now. High-value files are saved using |
37 |
duplicity to an S3 backend, fully gpg encrypted. Since I like to mess |
38 |
with zfs/btrfs I also keep a full replica of those drives locally on |
39 |
ext4 using rsnapshot. This is very easy to restore should btrfs eat |
40 |
my data (and I've made use of it twice). |
41 |
|
42 |
Rolling your own can certainly be an educational experience, but IMO |
43 |
it is unnecessary. Of course, be sure to test recovery no matter how |
44 |
you end up setting everything up. |
45 |
|
46 |
-- |
47 |
Rich |