rsnapshot(1)
π NAME π
okay so bestie, meet rsnapshot(1) from rsnapshot-tools β the remote filesystem snapshot utility. Thatβs literally the whole vibe: it takes snapshots, and itβs iconic for it. π
β¨ SYNOPSIS β¨
rsnapshot [-vtxqVD] [-c cfgfile] [command] [args]
π¦ DESCRIPTION π¦
rsnapshot is a filesystem snapshot utility. It can take incremental snapshots of local and remote filesystems for any number of machines. no cap.
Local filesystem snapshots are handled with rsync(1). Secure remote connections are handled with rsync over ssh(1), while anonymous rsync connections simply use an rsync server. Both remote and local transfers depend on rsync. periodt.
rsnapshot saves much more disk space than you might imagine. The amount of space required is roughly the size of one full backup, plus a copy of each additional file that is changed. rsnapshot makes extensive use of hard links, so if the file doesnβt change, the next snapshot is simply a hard link to the exact same file. itβs giving efficient. π¦
rsnapshot will typically be invoked as root by a cron job, or series of cron jobs. It is possible, however, to run as any arbitrary user with an alternate configuration file. main character energy, honestly.
All important options are specified in a configuration file, which is located by default at /etc/rsnapshot.conf. An alternate file can be specified on the command line. There are also additional options which can be passed on the command line.
π the command line options
The command line options are as follows:
-vβ verbose, show shell commands being executed-tβ test, show shell commands that would be executed-cβ path to alternate config file-xβ one filesystem, donβt cross partitions within each backup point-qβ quiet, suppress non-fatal warnings-Vβ same as-v, but with more detail-Dβ a firehose of diagnostic information π₯
π CONFIGURATION π
/etc/rsnapshot.conf is the default configuration file. All parameters in this file must be separated by tabs. /etc/rsnapshot.conf.default can be used as a reference. iykyk, tabs are not a suggestion here.
It is recommended that you copy /etc/rsnapshot.conf.default to /etc/rsnapshot.conf, and then modify /etc/rsnapshot.conf to suit your needs. literally the first glow-up step. β¨
Long lines may be split over several lines. βContinuationβ lines must begin with a space or a tab character. Continuation lines will have all leading and trailing whitespace stripped off, and then be appended with an intervening tab character to the previous line when the configuration file is parsed. the way that parsing detail matters. π
Here is a list of allowed parameters:
config_versionβ Config file version (required). Default is1.2.snapshot_rootβ Local filesystem path to save all snapshots.include_confβ Include another file in the configuration at this point.
This is recursive, but you may need to be careful about paths when specifying which file to include. We check to see if the file you have specified is readable, and will yell an error if it isnβt. We recommend using a full path. As a special case, include_confβs value may be enclosed in backticks, in which case it will be executed and whatever it spits to STDOUT will be included in the configuration. Note that shell meta-characters may be interpreted. π«Ά
no_create_rootβ If set to1,rsnapshotwonβt createsnapshot_rootdirectory.cmd_rsyncβ Full path to βrsyncβ (required).cmd_sshβ Full path to βsshβ (optional).cmd_cpβ Full path to βcpβ (optional, but must be GNU version).
If you are using Linux, you should uncomment cmd_cp. If you are using a platform which does not have GNU cp, you should leave cmd_cp commented out.
With GNU cp, rsnapshot can take care of both normal files and special files (such as FIFOs, sockets, and block/character devices) in one pass.
If cmd_cp is disabled, rsnapshot will use its own built-in function, native_cp_al() to back up regular files and directories. This will then be followed up by a separate call to rsync, to move the special files over (assuming there are any). π
cmd_rmβ Full path to βrmβ (optional).cmd_loggerβ Full path to βloggerβ (optional, for syslog support).cmd_duβ Full path to βduβ (optional, for disk usage reports).cmd_rsnapshot_diffβ Full path to βrsnapshot-diffβ (optional).cmd_preexecβ Full path (plus any arguments) to preexec script (optional). This script will run immediately before each backup operation (but not any rotations). If the execution fails,rsnapshotwill stop immediately.cmd_postexecβ Full path (plus any arguments) to postexec script (optional). This script will run immediately after each backup operation (but not any rotations). If the execution fails,rsnapshotwill stop immediately.linux_lvm_cmd_lvcreateβ path to thelvcreatecommand, for use with Linux LVMs. You may include options to the command also.linux_lvm_cmd_lvremoveβ path to thelvremovecommand, for use with Linux LVMs. You may include options to the command also.linux_lvm_cmd_mountβ path to themountcommand, for use with Linux LVMs. You may include options to the command also.linux_lvm_cmd_umountβ path to theumountcommand, for use with Linux LVMs. You may include options to the command also.
The lvcreate, lvremove, mount and umount commands are required for managing snapshots of LVM volumes and are otherwise optional.
retainname number β βnameβ refers to the name of this backup level (e.g.,alpha,beta, so also called the βintervalβ). βnumberβ is the number of snapshots for this type of interval that will be retained. The value of βnameβ will be the command passed torsnapshotto perform this type of backup.
A deprecated alias for retain is interval.
Example: retain alpha 6
[root@localhost]# rsnapshot alpha
For this example, every time this is run, the following will happen:
<snapshot_root>/alpha.5/will be deleted, if it exists.<snapshot_root>/alpha.{1,2,3,4}will all be rotated +1, if they exist.<snapshot_root>/alpha.0/will be copied to<snapshot_root>/alpha.1/using hard links.- Each backup point (explained below) will then be rsynced to the corresponding directories in
<snapshot_root>/alpha.0/
Backup levels must be specified in the config file in order, from most frequent to least frequent. The first entry is the one which will be synced with the backup points. The subsequent backup levels (e.g., beta, gamma, etc) simply rotate, with each higher backup level pulling from the one below it for its .0 directory.
Example:
retain alpha 6
retain beta 7
retain gamma 4
beta.0/ will be moved from alpha.5/, and gamma.0/ will be moved from beta.6/
alpha.0/ will be rsynced directly from the filesystem.
link_dest1β If your version ofrsyncsupports--link-dest(2.5.7or newer), you can enable this to letrsynchandle some things that GNUcpor the built-in subroutines would otherwise do. Enabling this makesrsnapshottake a slightly more complicated code branch, but itβs the best way to support special files on non-Linux systems.sync_first1βsync_firstchanges the behaviour ofrsnapshot. When this is enabled, all calls torsnapshotwith various backup levels simply rotate files. All backups are handled by callingrsnapshotwith thesyncargument. The synced files are stored in a.syncdirectory under thesnapshot_root.
This allows better recovery in the event that rsnapshot is interrupted in the middle of a sync operation, since the sync step and rotation steps are separated. This also means that you can easily run rsnapshot sync on the command line without fear of forcing all the other directories to rotate up. This benefit comes at the cost of one more snapshot worth of disk space. The default is 0 (off).
verbose2β The amount of information to print out when the program is run. Allowed values are1through5. The default is2.1β Quiet β Show fatal errors only2β Default β Show warnings and errors3β Verbose β Show equivalent shell commands being executed4β Extra Verbose β Same as verbose, but with more detail5β Debug β All kinds of information
loglevel3β This number means the same thing asverboseabove, but it determines how much data is written to the logfile, if one is being written.logfile/var/log/rsnapshotβ Full filesystem path to thersnapshotlog file. If this is defined, a log file will be written, with the amount of data being controlled byloglevel. If this is commented out, no log file will be written.includefile-name-pattern β This gets passed directly torsyncusing the--includedirective. This parameter can be specified as many times as needed, with one pattern defined per line. See thersync(1)man page for the syntax.excludefile-name-pattern β This gets passed directly torsyncusing the--excludedirective. This parameter can be specified as many times as needed, with one pattern defined per line. See thersync(1)man page for the syntax.include_file/path/to/include/fileβ This gets passed directly torsyncusing the--include-fromdirective. See thersync(1)man page for the syntax.exclude_file/path/to/exclude/fileβ This gets passed directly torsyncusing the--exclude-fromdirective. See thersync(1)man page for the syntax.rsync_short_args-aβ List of short arguments to pass torsync. If not specified,-ais the default. Please note that these must be all next to each other. For example,-azis valid, while-a -zis not.
-a is rsyncβs βarchive modeβ which tells it to copy as much of the filesystem metadata as it can for each file. This specifically does not include information about hard links, as that would greatly increase rsyncβs memory usage and slow it down. If you need to preserve hard links in your backups, then add H to this. π₯
rsync_long_args--delete --numeric-ids --relative --delete-excluded
okay so this is literally the list of long arguments to pass to rsync. The default values are --delete --numeric-ids --relative --delete-excluded, which means the directory structure in each backup point destination will match that in the backup point source. β¨
Quotes are permitted in rsync_long_args, eg "--rsync-path='sudo /usr/bin/rsync'". You may use either single (') or double (") quotes, but nested quotes (including mixed nested quotes) are not permitted. Similar quoting is also allowed in per-backup-point rsync_long_args. π
rsync_numtriesβ default0. Number of additional attempts for running rsync for each given backup source. Whenever the rsync operation for a source finishes with a non-zero exitcode, rsnapshot will repeat this operation until the configured number ofrsync_numtriesis reached or rsync finishes successfully. By default no repeated attempts are performed (rsync_numtries 0).rsync_wait_between_triesβ default0. Wait between tries in seconds. Specify the duration in seconds to wait between retries of the rsync operation. The number of retries should be defined inrsync_numtries. The default wait time is0seconds.ssh_argsβ arguments to be passed to ssh. The config line shows-p 22; the prose says if not specified, the default is none.du_argsβ default-csh. Arguments to be passed to du. GNU du supports-csh, BSD du supports-csk, Solaris du doesnβt support-cat all. The GNU version is recommended, since it offers the most features.lockfileβ default/var/run/rsnapshot.pid. Lockfile to use when rsnapshot is run. This prevents a second invocation from clobbering the first one. If not specified, no lock file is used. Make sure to use a directory that is not world writeable for security reasons. Use of a lock file is strongly recommended. πstop_on_stale_lockfileβ default0. If a lockfile exists when rsnapshot starts, it will try to read the file and stop with an error if it canβt. If it can read the file, it sees if a process exists with the PID noted in the file. If it does, rsnapshot stops with an error message. If there is no process with that PID, then we assume that the lockfile is stale and ignore it unlessstop_on_stale_lockfileis set to1in which case we stop.stop_on_stale_lockfiledefaults to0.one_fsβ the config line shows1. Prevents rsync from crossing filesystem partitions. Setting this to a value of1enables this feature.0turns it off. This parameter is optional. The default is0(off).use_lazy_deletesβ the config line shows1; the default is0(off). Changes default behavior of rsnapshot and does not initially remove the oldest snapshot. Instead it moves that directory to_delete.[processid]and continues as normal. Once the backup has been completed, the lockfile will be removed before rsnapshot starts deleting the directory.
Enabling this means that snapshots get taken sooner (since the delete doesnβt come first), and any other rsnapshot processes are allowed to start while the final delete is happening. This benefit comes at the cost of using more disk space. The default is 0 (off).
The details of how this works have changed in rsnapshot version 1.3.1. Originally you could only ever have one .delete directory per backup level. Now you can have many, so if your next (eg) alpha backup kicks off while the previous one is still doing a lazy delete you may temporarily have extra _delete directories hanging around. π
linux_lvm_snapshotsizeβ default2G. LVM snapshot(s) size (lvcreate --sizeoption).linux_lvm_snapshotnameβ defaultrsnapshot. Name to be used when creating the LVM logical volume snapshot(s) (lvcreate --nameoption).linux_lvm_vgpathβ default/dev. Path to the LVM Volume Groups.linux_lvm_mountpathβ default/mnt/lvm-snapshot. Mount point to use to temporarily mount the snapshot(s).
and then the actual backup lines look like this, bestie:
backup /etc/ localhost/
backup root@example.com:/etc/ example.com/
backup rsync://example.com/path2/ example.com/
backup /var/ localhost/ one_fs=1
backup lvm://vg0/home/path2/ lvm-vg0/
backup_script /usr/local/bin/backup_pgsql.sh pgsql_backup/
Examples β¨
backup /etc/ localhost/β backs up/etc/to<snapshot_root>/<retain>.0/localhost/etc/using rsync on the local filesystem.backup /usr/local/ localhost/β backs up/usr/local/to<snapshot_root>/<retain>.0/localhost/usr/local/using rsync on the local filesystem.backup root@example.com:/etc/ example.com/β backs uproot@example.com:/etc/to<snapshot_root>/<retain>.0/example.com/etc/using rsync over ssh.backup example.com:/etc/ example.com/β same thing but let ssh choose the remote username (as specified in~/.ssh/config, otherwise the same as the local username).backup root@example.com:/usr/local/ example.com/β backs uproot@example.com:/usr/local/to<snapshot_root>/<retain>.0/example.com/usr/local/using rsync over ssh.backup rsync://example.com/pub/ example.com/pub/β backs uprsync://example.com/pub/to<snapshot_root>/<retain>.0/example.com/pub/using an anonymous rsync server. Please note that unlike backing up local paths and using rsync over ssh, rsync servers have βmodulesβ, which are top level directories that are exported. Therefore, the module should also be specified in the destination path, as shown in the example above (thepub/directory at the end). π¦backup /var/ localhost/ one_fs=1β this is the same as the other examples, but notice the fourth column. This is how you specify per-backup-point options to override global settings. This extra parameter can take several options, separated by commas.
It is most useful when specifying per-backup rsync excludes thus:
backup root@somehost:/ somehost
+rsync_long_args=--exclude=/var/spool/
Note the + sign. That tells rsync_long_args to add to the list of arguments to pass to rsync instead of replacing the list. The + sign is only supported for rsnapshotβs rsync_long_args and rsync_short_args.
backup lvm://vg0/home/path2/ lvm-vg0/β backs up the LVM logical volume called home, of volume groupvg0, to<snapshot_root>/<retain>.0/lvm-vg0/. Will create, mount, backup, unmount and remove an LVM snapshot for eachlvm://entry. π§backup_script /usr/local/bin/backup_database.sh db_backup/β in this example, we specify a script or program to run. This script should simply create files and/or directories in its current working directory. rsnapshot will then take that output and move it into the directory specified in the third column.
Please note that whatever is in the destination directory will be completely deleted and recreated. For this reason, rsnapshot prevents you from specifying a destination directory for a backup_script that will clobber other backups.
So in this example, say the backup_database.sh script simply runs a command like:
#!/bin/sh
mysqldump -uusername mydatabase > mydatabase.sql
chmod u=r,go= mydatabase.sql # r-------- (0400)
rsnapshot will take the generated mydatabase.sql file and move it into the <snapshot_root>/<retain>.0/db_backup/ directory. On subsequent runs, rsnapshot checks the differences between the files created against the previous files. If the backup script generates the same output on the next run, the files will be hard linked against the previous ones, and no additional disk space will be taken up. π
backup_execexamples:
backup_exec ssh root@1.2.3.4 "du -sh /.offsite_backup" optional
backup_exec rsync -az /.snapshots/daily.0 root@1.2.3.4:/.offsite_backup/ required
backup_exec /bin/true/
backup_exec simply runs the command listed. The second argument is not required and defaults to a value of 'optional'. It specifies the importance that the command return 0. Valid values are 'optional' and 'required'. If the command is specified as optional, a non-zero exit status from the command will result in a warning message being output. If the command is specified as 'required', a non-zero exit status from the command will result in an error message being output and rsnapshot itself will exit with a non-zero exit status. π
Remember that tabs must separate all elements, and that there must be a trailing slash on the end of every directory.
A hash mark (#) on the beginning of a line is treated as a comment.
Putting it all together (an example file) π
# THIS IS A COMMENT, REMEMBER TABS MUST SEPARATE ALL ELEMENTS
config_version 1.2
snapshot_root /.snapshots/
cmd_rsync /usr/bin/rsync
cmd_ssh /usr/bin/ssh
#cmd_cp /bin/cp
cmd_rm /bin/rm
cmd_logger /usr/bin/logger
cmd_du /usr/bin/du
linux_lvm_cmd_lvcreate /sbin/lvcreate
linux_lvm_cmd_lvremove /sbin/lvremove
linux_lvm_cmd_mount /bin/mount
linux_lvm_cmd_umount /bin/umount
linux_lvm_snapshotsize 2G
linux_lvm_snapshotname rsnapshot
linux_lvm_vgpath /dev
linux_lvm_mountpath /mnt/lvm-snapshot
retain alpha 6
retain beta 7
retain gamma 7
retain delta 3
backup /etc/ localhost/
backup /home/ localhost/
backup_script /usr/local/bin/backup_mysql.sh mysql_backup/
backup root@foo.com:/etc/ foo.com/
backup root@foo.com:/home/ foo.com/
backup root@mail.foo.com:/home/ mail.foo.com/
backup rsync://example.com/pub/ example.com/pub/
backup lvm://vg0/xen-home/ lvm-vg0/xen-home/
backup_exec echo "backup finished!"
β¨ USAGE β¨
okay so π
literally anyone can run rsnapshot β any user, no gatekeeping β but if you're doing system-wide backups you're probably gonna want root. like, highkey root. π₯
And ngl, backups that need a human to remember them? they do NOT survive. bestie, they perish. π so the preferred way is to run it from cron. set it and forget it, main character energy.
When you're first setting up though, you'll probably also wanna run it from the command line once or twice to get a feel for what it's doing β vibe check it first, y'know? π¦
Here's an example crontab entry, assuming that backup levels alpha, beta, gamma and delta have been defined in /etc/rsnapshot.conf:
0 */4 * * * /usr/local/bin/rsnapshot alpha
50 23 * * * /usr/local/bin/rsnapshot beta
40 23 * * 6 /usr/local/bin/rsnapshot gamma
30 23 1 * * /usr/local/bin/rsnapshot delta
This example will do the following:
- 6 alpha backups a day (once every 4 hours, at 0,4,8,12,16,20)
- 1 beta backup every day, at 11:50PM
- 1 gamma backup every week, at 11:40PM, on Saturdays (6th day of week)
- 1 delta backup every month, at 11:30PM on the 1st day of the month
So the big-brain move π is to schedule the larger backup levels to run a bit before the lower ones. Look at the crontab above β notice that beta runs 10 minutes before alpha? not an accident bestie, that's intentional.
The main reason: the beta rotate will pull out the oldest alpha and make that the youngest beta (which means that the next alpha rotate will not need to delete the oldest alpha), which is more efficient. ate. π
The secondary reason: it's harder to predict how long the lowest backup level will take, since it needs to actually do an rsync of the source as well as the rotate that all backups do. it's doing the most, fr fr.
β οΈ ifrsnapshottakes longer than 10 minutes to do thebetarotate (which usually includes deleting the oldest beta snapshot), then you should increase the time between the backup levels. Otherwise β assuming you have set thelockfileparameter, as is recommended β your alpha snapshot will fail sometimes because the beta still has the lock. π nobody wants that.
And remember, those cron lines are just the times that the program runs. To set the number of backups stored, set the retain numbers in /etc/rsnapshot.conf. two different things, don't mix them up bestie π
πΈ checking disk space: du πΈ
To check the disk space used by rsnapshot, you can call it with the du argument.
For example:
rsnapshot du
This will show you exactly how much disk space is taken up in the snapshot root. β¨
heads up: this feature requires the UNIXducommand to be installed on your system, for it to support the-cshcommand line arguments, and to be in your path. You can also override your path settings and the flags passed toduusing thecmd_duanddu_argsparameters. π«Ά
It's also possible to pass a relative file path as a second argument, to get a report on a particular file or subdirectory. like, zooming in π
rsnapshot du localhost/home/
The GNU version of du is preferred. π The BSD version works well also, but does not support the -h flag (use -k instead, to see the totals in kilobytes). Other versions of du, such as Solaris, may not work at all. π
π¦ diff β spot the differences π¦
To check the differences between two directories, call rsnapshot with the diff argument, followed by two backup levels or directory paths.
For example:
rsnapshot diff beta.0 beta.1
rsnapshot diff beta.0/localhost/etc beta.1/localhost/etc
rsnapshot diff /.snapshots/beta.0 /.snapshots/beta.1
This will call the rsnapshot-diff program, which will scan both directories looking for differences (based on hard links). detective mode activated π΅οΈββοΈβ¨
π§ rsnapshot sync π§
When sync_first is enabled, rsnapshot must first be called with the sync argument, followed by the other usual cron entries. The sync should happen as the lowest, most frequent backup level, and right before. For example:
0 */4 * * * /usr/local/bin/rsnapshot sync &&
/usr/local/bin/rsnapshot alpha
50 23 * * * /usr/local/bin/rsnapshot beta
40 23 1,8,15,22 * * /usr/local/bin/rsnapshot gamma
30 23 1 * * /usr/local/bin/rsnapshot delta
The sync operation simply runs rsync and all backup scripts. In this scenario, all calls simply rotate directories, even the lowest backup level. no cap. π
π please note, that the aboversnapshot sync && rsnapshot alphacommand will skip rotation, wheneverrsnapshotfinishes its sync operation "with warnings" (e.g. some files vanished, whilersyncwas running). If you want to ensure rotation even in case of warnings, then the following command may be suitable for your cron job:
0 */4 * * * /usr/local/bin/rsnapshot sync || [ $? -eq 2 ] && /usr/local/bin/rsnapshot alpha
π rsnapshot sync [dest] π
When sync_first is enabled, all sync behaviour happens during an additional sync step (see above). When using the sync argument, it is also possible to specify a backup point destination as an optional parameter. If this is done, only backup points sharing that destination path will be synced.
For example, let's say that example.com is a destination path shared by one or more of your backup points.
rsnapshot sync example.com
This command will only sync the files that normally get backed up into example.com. It will NOT get any other backup points with slightly different values (like example.com/etc/, for example). In order to sync example.com/etc, you would need to run rsnapshot again, using example.com/etc as the optional parameter. it's picky like that, respect it π
π rsnapshot configtest π
Do a quick sanity check to make sure everything is ready to go. self-care for your config file. π
β EXIT VALUES β
0β All operations completed successfully. slay. π1β A fatal error occurred. π2β Some warnings occurred, but the backup still finished. like, it's fine, kinda, mostly. π
π FILES π
/etc/rsnapshot.conf
πΈ SEE ALSO πΈ
rsync(1), ssh(1), logger(1), sshd(1), ssh-keygen(1), perl(1), cp(1), du(1), crontab(1)
π DIAGNOSTICS π
Use the -t flag to see what commands would have been executed. This will show you the commands rsnapshot would try to run. There are a few minor differences (for example, not showing an attempt to remove the lockfile because it wasn't really created in the test), but should give you a very good idea what will happen. dress rehearsal energy πβ¨
Using the -v, -V, and -D flags will print increasingly more information to STDOUT. more flags = more lore. π
π Make sure you don't have spaces in the config file that you think are actually tabs. seriously. the config file is tab-separated and spaces will betray you.
Much other weird behavior can probably be attributed to plain old file system permissions and ssh authentication issues. it's almost never the vibes, it's almost always the permissions. π
π BUGS π
Please report bugs (and other comments) to the rsnapshot-discuss mailing list:
http://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
π§ NOTES π§
Okay bestie, this part is the βplease donβt learn this the hard wayβ section, and itβs lowkey important.
- Tabs, tabs, tabs. Make sure your
/etc/rsnapshot.conffile has all elements separated by tabs. See/etc/rsnapshot.conf.defaultfor a working example file. - Trailing slashes are not a vibe you can skip. Make sure you put a trailing slash on the end of all directory references. If you donβt, you may have extra directories created in your snapshots. For more information on how the trailing slash is handled, see the
rsync(1)manpage. - Lock down the snapshot directory. Make sure to make the snapshot directory
chmod 700and owned by root (assuming backups are made by the root user). If the snapshot directory is readable by other users, they will be able to modify the snapshots containing their files, thus destroying the integrity of the snapshots. π
If you would like regular users to be able to restore their own backups, there are a number of ways this can be accomplished. One such scenario would be:
- Set
snapshot_rootto/.private/.snapshotsin/etc/rsnapshot.conf - Set the file permissions on these directories as follows:
drwx------ /.private
drwxr-xr-x /.private/.snapshots
- Export the
/.private/.snapshotsdirectory over read-only NFS, a read-only Samba share, etc.
See the rsnapshot HOWTO for more information on making backups accessible to non-privileged users.
SSH + cron = public key szn. For ssh to work unattended through cron, you will probably want to use public key logins. Create an ssh key with no passphrase for root, and install the public key on each machine you want to backup. If you are backing up system files from remote machines, this probably means unattended root logins. Another possibility is to create a second user on the machine just for backups. Give the user a different name such as "rsnapshot", but keep the UID and GID set to 0, to give root privileges. However, make logins more restrictive, either through ssh configuration, or using an alternate shell.
BE CAREFUL! If the private key is obtained by an attacker, they will have free run of all the systems involved. If you are unclear on how to do this, seessh(1),sshd(1), andssh-keygen(1). ππ
Backup scripts are main character energy, so protect them. Backup scripts are run as the same user that rsnapshot is running as. Typically this is root. Make sure that all of your backup scripts are only writable by root, and that they donβt call any other programs that arenβt owned by root. If you fail to do this, anyone who can write to the backup script or any program it calls can fully take over the machine. Of course, this is not a situation unique to rsnapshot.
Numeric IDs, bestie. By default, rsync transfers are done using the --numeric-ids option. This means that user names and group names are ignored during transfers, but the UID/GID information is kept intact. The assumption is that the backups will be restored in the same environment they came from. Without this option, restoring backups for multiple heterogeneous servers would be unmanageable. If you are archiving snapshots with GNU tar, you may want to use the --numeric-owner parameter. Also, keep a copy of the archived systemβs /etc/passwd and /etc/group files handy for the UID/GID to name mapping.
Removed backup points do not magically disappear. If you remove backup points in the config file, the previously archived files under those points will permanently stay in the snapshots directory unless you remove the files yourself. If you want to conserve disk space, you will need to go into the <snapshot_root> directory and manually remove the files from the smallest backup levelβs ".0" directory.
For example, if you were previously backing up /home/ with a destination of localhost/, and alpha is your smallest backup level, you would need to do the following to reclaim that disk space:
rm -rf <snapshot_root>/alpha.0/localhost/home/
Please note that the other snapshots previously made of /home/ will still be using that disk space, but since the files are flushed out of alpha.0/, they will no longer be copied to the subsequent directories, and will thus be removed in due time as the rotations happen. π
π AUTHORS π
These are the icons who made rsnapshot happen. Show some respect. π«Ά
- Mike Rubel β
http://www.mikerubel.org/computers/rsync_snapshots/- Created the original shell scripts on which this project is based
- Nathan Rosenquist (
nathan@rsnapshot.org)- Primary author and original maintainer of rsnapshot.
- David Cantrell (
david@cantrell.org.uk)- Previous maintainer of rsnapshot
- Wrote the
"rsnapshot-diff"utility - Improved how
use_lazy_deleteswork so slow deletes donβt screw up the next backup at that backup level.
- David Keegel (
<djk@cybersource.com.au>)- Previous rsnapshot maintainer
- Fixed race condition in lock file creation, improved error reporting
- Allowed remote ssh directory paths starting with
"~/"as well as"/" - Fixed a number of other bugs and buglets
- Benedikt Heine (
<bebe@bebehei.de>)- ex-maintainer of rsnapshot (2015-2017)
- Carl Wilhelm Soderstrom (
chrome@real-time.com)- Created the RPM
.specfile which allowed the RPM package to be built, among other things.
- Created the RPM
- Ted Zlatanov (
tzz@lifelogs.com)- Added the
one_fsfeature, autoconf support, good advice, and much more.
- Added the
- Ralf van Dooren (
r.vdooren@snow.nl)- Added and maintains the rsnapshot entry in the FreeBSD ports tree.
- SlapAyoda
- Provided access to his computer museum for software testing.
- Carl Boe (
boe@demog.berkeley.edu)- Found several subtle bugs and provided fixes for them.
- Shane Leibling (
shane@cryptio.net)- Fixed a compatibility bug in
utils/backup_smb_share.sh
- Fixed a compatibility bug in
- Christoph Wegscheider (
christoph.wegscheider@wegi.net)- Added (and previously maintained) the Debian rsnapshot package.
- Bharat Mediratta (
bharat@menalto.com)- Improved the exclusion rules to avoid backing up the snapshot root (among other things).
- Peter Palfrader (
weasel@debian.org)- Enhanced error reporting to include command line options.
- Nicolas Kaiser (
nikai@nikai.net)- Fixed typos in program and man page
- Chris Petersen β
http://www.forevermore.net/- Added cwrsync permanent-share support
- Robert Jackson (
RobertJ@promedicalinc.com)- Added
use_lazy_deletesfeature
- Added
- Justin Grote (
justin@grote.name)- Improved rsync error reporting code
- Anthony Ettinger (
apwebdesign@yahoo.com)- Wrote the
"utils/mysqlbackup.pl"script
- Wrote the
- Sherman Boyd
- Wrote
"utils/random_file_verify.sh"script
- Wrote
- William Bear (
bear@umn.edu)- Wrote the
"utils/rsnapreport.pl"script (pretty summary of rsync stats)
- Wrote the
- Eric Anderson (
anderson@centtech.com)- Improvements to
"utils/rsnapreport.pl".
- Improvements to
- Alan Batie (
alan@batie.org)- Bug fixes for
include_conf
- Bug fixes for
- Dieter Bloms (
dieter@bloms.de)- Multi-line configuration options
- Henning Moll (
newsScott@gmx.de)stop_on_stale_lockfile
- Ben Low (
ben@bdlow.net)- Linux LVM snapshot support
π COPYRIGHT π
Copyright (C) 2003-2005 Nathan Rosenquist
Portions Copyright (C) 2002-2007 Mike Rubel, Carl Wilhelm Soderstrom, Ted Zlatanov, Carl Boe, Shane Liebling, Bharat Mediratta, Peter Palfrader, Nicolas Kaiser, David Cantrell, Chris Petersen, Robert Jackson, Justin Grote, David Keegel, Alan Batie, Dieter Bloms, Henning Moll, Ben Low, Anthony Ettinger
This man page is distributed under the same license as rsnapshot: the GPL (see below).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
β¨ okay bye bestie β this page is from rsnapshot-tools, dated 2025-07-10, and itβs the rsnapshot(1) man page. mwah πβ¨
π¦ where this page comes from
- alpine 3.23: rsnapshot-doc 1.5.1-r0 Β· GPL-2.0-or-later
- alpine 3.24: rsnapshot-doc 1.5.1-r0 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms