rsnapshot

a tool for backing up your data using rsync (if you want to get help, use https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss)

Subscribe to updates I use rsnapshot


Statistics on rsnapshot

Number of watchers on Github 1156
Number of open issues 61
Average time to close an issue about 1 month
Main language Perl
Average time to merge a PR 2 months
Open pull requests 24+
Closed pull requests 23+
Last commit 8 months ago
Repo Created almost 6 years ago
Repo Last Updated about 1 month ago
Size 1.92 MB
Homepage http://rsnapshot.org
Organization / Authorrsnapshot
Latest Release1.4.2
Contributors12
Page Updated
Do you use rsnapshot? Leave a review!
View open issues (61)
View rsnapshot activity
View on github
Latest Open Source Launches
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating rsnapshot for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

RSNAPSHOT Build Status

rsnapshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details.

rsnapshot is a filesystem snapshot utility based on rsync. rsnapshot makes it easy to make periodic snapshots of local machines, and remote machines over ssh. The code makes extensive use of hard links whenever possible, to greatly reduce the disk space required.

It is written entirely in perl with no module dependencies, and has been tested with versions 5.004 through 5.16.3. It should work on any reasonably modern UNIX compatible OS. It has been tested successfully on the following operating systems:

  • Debian: 3.0 (woody), 3.1 (sarge), unstable (sid)
  • Redhat: 7.x, 8.0
  • RedHat Enterprise Linux: 3.0 ES, 5, 6
  • Fedora Core: 1, 3
  • Fedora: 17, 18
  • CentOS: 3, 4, 5, 6
  • WhiteBox Enterprise Linux 3.0
  • Slackware 9.0
  • SuSE: 9.0
  • FreeBSD 4.9-STABLE
  • OpenBSD 3.x
  • Solaris 8 (SPARC and x86)
  • Mac OS X
  • IRIX 6.5

If this is your first experience with rsnapshot, you may want to read the rsnapshot HOWTO at http://www.rsnapshot.org/. The HOWTO will give you a detailed walk-through on how to get rsnapshot up and running in explicit detail.

For a reference of all available commands, see the rsnapshot man page.

If you are upgrading from version 1.1.6 or earlier, make sure you read the file Upgrading from 1.1.

For installation or upgrade instructions please read the INSTALL doc.

If you want to work on improving rsnapshot please read the CONTRIBUTING doc.

If you want to ask a question or have a general discussion use the Mailing List.

COMPATIBILITY NOTICES (Please read)

  1. Note that systems which use GNU cp version 5.9 or later will have problems with rsnapshot versions up to and including 1.2.3, if cmd_cp is enabled (and points at the later gnu cp). This is no longer a problem since rsnapshot 1.2.9, as it strips off trailing slashes when running cp.

  2. If you have rsync version 2.5.7 or later, you may want to enable the link_dest parameter in the rsnapshot.conf file.

    If you are running Linux but do not have the problem above, you should enable the cmd_cp parameter in rsnapshot.conf (especially if you do not have link_dest enabled).

    Be advised that currently link_dest doesn't do well with unavailable hosts. Specifically, if a remote host is unavailable using link_dest, there will be no latest backup of that machine, and a full re-sync will be required when it becomes available. Using the other methods, the last good snapshot will be preserved, preventing the need for a re-sync. We hope to streamline this in the future.

CONFIGURATION

Once you have installed rsnapshot, you will need to configure it. The default configuration file is /etc/rsnapshot.conf, although the exact path may be different depending on how the program was installed. If this file does not exist, copy /etc/rsnapshot.conf.default over to /etc/rsnapshot.conf and edit it to suit your tastes. See the man page for the full list of configuration options.

When /etc/rsnapshot.conf contains your chosen settings, do a quick sanity check to make sure everything is ready to go:

$ rsnapshot configtest

If this works, you can see essentially what will happen when you run it for real by executing the following command (where interval is alpha, beta, etc):

$ rsnapshot -t [interval]

Once you are happy with everything, the final step is to setup a cron job to automate your backups. Here is a quick example which makes backups every four hours, and beta backups for a week:

0 */4 * * *     /usr/local/bin/rsnapshot alpha
50 23 * * *     /usr/local/bin/rsnapshot beta

In the previous example, there will be six alpha snapshots taken each day (at 0,4,8,12,16, and 20 hours). There will also be beta snapshots taken every night at 11:50PM. The number of snapshots that are saved depends on the interval settings in /etc/rsnapshot.conf.

For example:

interval    alpha       6

This means that every time rsnapshot alpha is run, it will make a new snapshot, rotate the old ones, and retain the most recent six (alpha.0 - alpha.5).

If you prefer instead to have three levels of backups (which we'll call beta, gamma and delta), you might set up cron like this:

00 00 * * *     /usr/local/bin/rsnapshot beta
00 23 * * 6     /usr/local/bin/rsnapshot gamma
00 22 1 * *     /usr/local/bin/rsnapshot delta

This specifies a beta rsnapshot at midnight, a gamma snapshot on Saturdays at 11:00pm and a delta rsnapshot at 10pm on the first day of each month.

Note that the backups are done from the highest interval first (in this case delta) and go down to the lowest interval. If you are not having cron invoke the alpha snapshot interval, then you must also ensure that alpha is not listed as one of your intervals in rsnapshot.conf (for example, comment out alpha, so that beta becomes the lowest interval).

Remember that it is only the lowest interval which actually does the rsync to back up the relevant source directories, the higher intervals just rotate snapshots around. Unless you have enabled sync_first in your configuration-file, in which case only the sync pseudo-interval does the actual rsync, and all real intervals just rotate snapshots.

For the full documentation, type man rsnapshot once it is installed, or visit http://www.rsnapshot.org/. The HowTo on the web site has a detailed overview of how to install and configure rsnapshot, and things like how to set it up so users can restore their own files.

If you plan on using the backup_script parameter in your backup scheme, take a look at the utils/-directory in the source distribution for several example scripts. The utils/rsnapreport.pl script is well worth a look.

AUTHORS

Please see the AUTHORS file for the complete list of contributors.

rsnapshot open issues Ask a question     (View All Issues)
  • over 1 year rsnapshot fails with uninitialized lvm values if lvm backup before file backups
  • over 1 year left over _delete.<pid> directories after server crash 1.3.1
  • over 1 year rsync_numtries should consider OK some retcodes > 0
  • over 1 year wish: ship with example systemd config files
  • over 1 year Adjust logging for backup periods that didn't run
  • over 1 year rsnapshot does not cope well with file renames
  • almost 2 years At certain conditions rsnapshot removes old backups without make new ones
  • about 2 years ERROR: rsync_cleanup_after_native_cp_al() only works on directories
  • over 2 years rm -rf cannot remove directories with . in the name
  • over 2 years Directories with Spaces fail
  • over 2 years Please accept whitespaces as separators in rsnapshot.conf
  • almost 3 years how to use newest snapshot instead of oldest in rotation?
  • almost 3 years Postexec should be run after lazy deletes
  • almost 3 years Running multiple instances at once
  • almost 3 years HOWTO is missing?
  • almost 3 years preexec fails at least for rsnapshot daily.
  • about 3 years Add environment-variables containing cmd_* configuration-options to shell-executions.
  • about 3 years Re: [sourceforge-issues] [Feature] Please add the possibility to run rsnapshot in push mode
  • about 3 years More ideas for tests
  • over 3 years with sync_first, sync should not roll back if failed
  • almost 4 years Destructive rotations
  • over 4 years rsnapshot fails on BTRFS
  • almost 5 years Additional per-backup excludes aren't properly merged
  • about 5 years rsnapshot-diff doesn't cope with symlink loops?
  • about 5 years use POSIX::lchown
rsnapshot open pull requests (View All Pulls)
  • Implement cmd_mkbackupdir option
  • Non-LVM backup source breaks after LVM backup source
  • Converted HOWTO to markdown
  • Makefile.PL support
  • Rotate only if there will be a new <interval>.0 folder
  • Add filter_file option
  • Add support for BTRFS snapshots
  • Add quotes to allow blank space in include/exclude filename.
  • Add support for BTRFS snapshots
  • add support for using BTRFS subvolumes instead of copying subdirectories
  • Add support for skipping _delete.$$ directory deletions
  • Add support for providing a dir to include_conf
  • Fixed headers on howto page
  • Rm redundant and erroneous check in rsync_cleanup_after_native_cp_al()
  • Restored rsync error code 23 as an important warning
  • Fixed a bug which happens if you set 'sync_firsti'; The error is
  • Implement command 'all' to run backup and all rotations in one go
  • small change to documentation
  • Allow change ssh/rsync binary in per backup options
  • Fix error when file matching "/rsync*" in backup.
  • Lower verbose level of rsync output requirement
  • fix location of true and false binaries on macOS
  • finish support for backup point LVM options, add new LVM mount option
  • fix rsnapreport problems (incorrect header, fail when rsync present, fail with LVM)
rsnapshot questions on Stackoverflow (View All Questions)
  • resume Rsnapshot to same drive
  • Rsnapshot loses directory slash when using rsync_long_args=
  • Rsnapshot does not run cmd_postexec script if there is an error
  • rsnapshot to multiple destinations
  • Wrong order of rsnapshot backups
  • rsnapshot, multiple backup destinations
  • Rsnapshot destination full - how to safely rerun?
  • php rsnapshot config generator, tabs does not work properly
  • rsnapshot on Linux fails with "returned 12 while processing"
  • Why points rsnapshot backup to live-system?
  • Rsnapshot - remote backup location
  • Rsnapshot without hard links?
  • Cygwin rSnapshot on windows Permission denied, while permissions are retained
  • RSnapshot reports errors using rsnapreport.pl: "NO STATS DATA"
  • Removing stale lockfile - rsnapshot doesn´t like my lock files
  • Using rsnapshot and mysqldump to backup remote mySQL Databases
  • Mirror rsnapshot backup directory
  • Rails Backups, rsnapshot, duplicity, crashplan?
  • How do I back up a SVN repository with rsnapshot, when the timestamps differ every time?
rsnapshot list of languages used
Other projects in Perl