Rsnapshot: filesystem snapshot utility based on rsync
rsnapshot.org
rsnapshot.org
Rsnapshot works quite well but over time I started having problems. I was using it to snapshot a web server with many files uploaded by users. Over time there were so many millions of files that trying to work with the rsnapshot directories required a lot of patience. There was one time when I needed to copy the files to another storage medium, I let rsync run for DAYS and there was no end in sight. There were also two instances where I had some filesystem (ext4) corruption within my rsnapshot tree and in the end the only way I could get it happy again was to delete some suspect backups from my chain.
If you're using it to backup anything more than /etc/, I'd strongly suggest using attic. It has these advantages over rsnapshot:
* Block-level dedup instead of file-level. If 1b changes in your 1g file, that's another 1g needed in your backup.
* Compression.
* Encryption via key file, and/or passphrase.
Disadvantages over rsnapshot:
* You access your backups via a fuse mount. This isn't awful but I admit it isn't as nice as direct access.
* If you are running attic from a local host to a remote one, the remote needs attic installed. Alternatively you can store your attic repo locally and mirror it remotely in some other way.
* It can take a long time to work with large backup chains.
You should either switch to Borg, which is a not-backwards-compatible fork of Attic:
https://borgbackup.readthedocs.io/en/stable/
Or you should switch to Obnam, which seems to have a cleaner implementation than Attic/Borg, and most importantly, a well-documented archive format:
Note that both have an archive format which is incompatible to Attic. Also note that some years ago Obnam had poor performance compared to Attic, but as far as I know, it became much faster since then.
[1] A serious bug which may cause data-loss has never been fixed, so Attic was removed from some distros such as Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=802619
https://github.com/bup/bup/blob/master/DESIGN http://obnam.org/bugs/more-details-dedup/
rsync.net here. We agree. Attic (well, borg, but whatever) is quickly becoming the de facto standard for nicely versioned, secure, portable remote backups to an SFTP/SSH capable host.
We recommended duplicity for many, many years (and in fact, contributed to its development) but it no longer looks like the smart choice given the problems it has with periodic retransmission of the entire backups, etc.
FWIW, we support attic and borg and just rolled out borg v1.x into production:
I haven't used obnam, but from the interwebs it seems like bup and borg are much much faster, with bup's forte being in the situation where many clients with similar files are backing up to a remote server over ssh (in this specific scenario, borg is slow and cumbersome), and in that it's just a git repository you can poke at. Otherwise, borg has encryption, deletion of old versions (still experimental in bup), and many other goodies.
[0] not really an atomic snapshot, of course - they don't make any more or less guarantees than rsnapshot and friends.
Duplicity is also another tools that uses rsync algorithm to find and stores differences, but makes unfortunately incremental backups. On upside - it can store backup on anything that you can push files (FTP, S3, IMAP, ...) and it is the only rsync-related solution with encryption I could find http://duplicity.nongnu.org/
There is also a very nice full solution - BoxBackup, which unfortunately looks not very active now. It is continuous backup, with block level de-duplication, client-side encryption. Unfortunately uses its own format, where I strongly prefer to have things more standard, so you can manually fix them if something goes wrong. https://www.boxbackup.org/
My favourite backup tool! It's a tragedy that it seems to have gone stale.
If you use Btrfs (or ZFS if you're on FreeBSD or illumos) then you can have proper filesystem snapshots with essentially no overhead. Since both filesystems are transactional, you're guaranteed to get a snapshot of a single transaction (resulting in no inconsistency). Unfortunately due to partial writes in database files, Btrfs has some performance issues when having copy-on-write enabled (which is required if you want snapshots) for a database file.
In my experience LVM snapshot performance is good, you can even make it small and let it grow to track the changes while you backup is running.
EDIT: actually rsnapshot has LVM snapshot support (since version 1.3.1 from Aug 31, 2008), so there you are.
I use mysqldump/pg_dump/etc. to create database dumps and copy them to backup storage, and rsync/rsnapshot to back up the app itself. There is no need to use a single tool to back up everything. If your app is well designed, there's not even any need to back up the database and the filesystem simultaneously.
Even SQLite has a .dump command.
Sure you can and if you can't, then get a better database!
A well functioning database should be able to deal with being inconsistently shutdown. If you can't take a snapshot of the disk then what's the difference between that and the power cord being pulled?
The main reason not to do this on a DB server is that the recovery time may large. That doesn't mean it can't be done though.
> Databases come with their own tools and/or commands for creating a consistent "dump". Nothing else is guaranteed to be safe.
Sure they do and you should use those as well, that doesn't mean you can't do this too.
Combine that with disk snapshotting and you're fine.
Well, stopping the database generally allows you to be able to back up static files.
We do not need a perfectly consistent file system backup as the starting point. Any internal inconsistency in the backup will be corrected by log replay.
- https://www.postgresql.org/docs/current/static/continuous-ar...
rsnapshot does give you entire folders of the state of the source at time of backup. It makes efficient use of space by using hardlinks for identical files, so only the delta takes up more space.
The big advantage over rsync, on top of being available over HTTP, is that the server only calculates the signatures file once for the life of the content, instead of calculating it for each and every client.
I know some distributions use that, but it's not very well known... yet ?
I use it to upload new versions of my java app since I have slow upload. Instead of always uploading ~40 MB JARs I just upload 1.8 MB diff which is of course much faster.
It depends on what you mean by efficient.
[0] http://www.mpipks-dresden.mpg.de/~mueller/docs/suse10.2/html... First reference I found on Google
For me things I value are encryption on the backup-host, and de-duplication. That lead me to obnam, and attic.
rsnapshot is a nice tool, because it only needs to transmit things that have changed, but without encryption it isn't something I'd personally want to run again.
I've been looking for an rsync-based tool with encryption, but really couldn't find any. There is that uses rsync way of finding differences & keeps change log, but this is in fact normal full-snapshot & incremental backups: http://duplicity.nongnu.org/
I've used rsnapshot for about ten years, mainly to make remote backups of data on SMB/AFP file servers, and something I had to actively discourage was staff using the moving of files/folders between higher level folders as a method of project management. One group in particular does video production so a project between yesterday and today might have only a change of a few bytes but because the project's folder was moved to a different parent folder (e.g. Completed/), rsnapshot would make a new complete backup of that project which could be tens of gigs. Filesystem snapshots like ZFS's avoid this problem but I haven't worked with how those are copied remotely.
I did not require de-dupe but did only want to transmit only the diffs since last back up. I also wanted a something that would be of minimal resource usage on remote end (for rsnapshot was just running an rsync daemon if I recall correctly). In the case of one Ruby library I looked at, the entire system needed to be installed on each remote host to work correctly, which was unacceptable in my scenario.
Primarily, it just feels like a solid tool and seems like it can be adapted to suit a lot of use cases (I have seen a config to allow backup of AWS RDS instances for instance).