Giter Club home page Giter Club logo

sourceforge-issues's Introduction

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.24.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), 9.9 (stretch)
  • Redhat: 7.x, 8.0
  • RedHat Enterprise Linux: 3.0 ES, 5, 6, 7
  • Fedora Core: 1, 3
  • Fedora: 17, 18
  • CentOS: 3, 4, 5, 6, 7
  • WhiteBox Enterprise Linux 3.0
  • Slackware 9.0
  • SuSE: 9.0
  • Gentoo Linux
  • 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 man page which will give you a detailed walk-through on how to get rsnapshot up and running and also serve as a reference of all available commands.

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:

retain	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.

Also remember that a higher interval will rotate the oldest snapshot of the interval one step lower as its newest snapshot. For instance if you set daily and weekly snapshots and set daily to keep 30 snapshots, the newest snapshot for weekly will be the oldest (30 day old) daily snapshot after a rotation.

For the full documentation, type man rsnapshot once it is installed. The HOWTO also 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.

sourceforge-issues's People

Contributors

bebehei avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sourceforge-issues's Issues

[Bug] rsync_cleanup_after_native_cp_al() only works on directories [sf#24]

Reported by nlshep on 2010-03-08 07:03 UTC
I've set up rsnapshot (version 1.3.1, with rsync version 3.0.6 on Gentoo Linux 32-bit) to back up my personal documents tree. When I first started everything worked fine. At some point, however, backups stopped working, with the following error:

rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot -Dc /etc/rsnapshot/nls.conf decminly

ERROR: rsync_cleanup_after_native_cp_al() only works on directories
ERROR: Error! cp_al("/mnt/scratch/snapshots/nls/decminly.0/", "/mnt/scratch/snapshots/nls/decminly.1/")

decminly.0 and decminly.1 are indeed directories. I tracked the problem down to a check on line 4691 (line number from the rsnapshot-program.pl file in the tarball), which determines whether something is a directory based on whether it has a trailing slash. Because, in certain instances, rsnapshot creates and uses paths without trailing slashes (for example, line 3233), this check fails. Wouldn't it be better to use the standard "-d some_path" for checking whether something is a directory, or is there some special reason the decision is made based on trailing slash here? If I change the condition to use the "-d" check, then everything works fine. Attached is a patch which implements this change.

[Bug] Stripping of trailing slashes from backup points [sf#15]

Reported by hashproduct on 2009-11-21 13:32 UTC
Rsnapshot strips trailing slashes from backup points when --relative is on. This was a workaround for a bug in rsync < 2.6.5 which can probably be carefully removed now. It has two ill effects:

- A symlink to a directory is not followed even if it was originally specified with a trailing slash.
When --relative is on and a symlink to a directory is given as a backup point, even with a trailing slash, the symlink is not followed. See https://sourceforge.net/mailarchive/forum.php?thread\_name=AufOOGUweQB%40helmut.hullen.de&forum\_name=rsnapshot-discuss .

- Minor: Attempting to append "./" to a backup point to negate the effect of --relative without actually disabling it does not work. "./." is needed, and that looks ugly.

[Patch] sync_first, link_dest and multiple backup points [sf#4]

Reported by noredshadow on 2007-11-27 03:52 UTC
This is a patch that I use to fix this bug: https://sourceforge.net/tracker/index.php?func=detail&aid=1643701&group\_id=88546&atid=587076

A quick recap:
If you set both sync_first and link_dest and then you try to backup multiple directories, then --link-dest will only be added to the rsync call for the first directory. This patch fixes the issue.

I tried to attach it to the bug directly, but I either couldn't or I was stupid and just copied and pasted it.

[Bug] Exclude-snapshot-root code doesn't check for per-backup-point --relative [sf#20]

Reported by jcpotts on 2010-02-07 10:20 UTC
First, thanks for rsnapshot.

Backing-up my complete system, and wanting a separate backup for each mount point (disk partition), i find myself having to resort to this overloaded config file (where some of the "backup" lines are commented out temporarily for a shorter dry-run report):

etc \# cat rsnapshot.conf1

config\_version  1.2
snapshot\_root   /mnt/usb-a2/.snapshots/
no\_create\_root  1
cmd\_cp          /bin/cp
cmd\_rm          /bin/rm
cmd\_rsync       /usr/bin/rsync
cmd\_du          /bin/du
cmd\_rsnapshot\_diff      /usr/bin/rsnapshot-diff
retain          daily   7
verbose         2
loglevel        3
rsync\_short\_args        -aCFHAX
rsync\_long\_args         --numeric-ids --relative --delete-excluded
du\_args -csh
one\_fs          1
include\_file    /usr/local/etc/rsync/backup-includes
exclude\_file    /usr/local/etc/rsync/backup-excludes
link\_dest       1
backup  /               localhost/TOP/
\#backup /home/          localhost/HOME/         rsync\_long\_args=--numeric-ids --delete-excluded --include-from=/usr/local/etc/rsync/backup-includes --exclude-from=/usr/local/etc/rsync/backup-excludes --exclude=mnt/usb-a2/.snapshots
\#backup /usr/           localhost/USR/          rsync\_long\_args=--numeric-ids --delete-excluded --include-from=/usr/local/etc/rsync/backup-includes --exclude-from=/usr/local/etc/rsync/backup-excludes --exclude=mnt/usb-a2/.snapshots
\#backup /usr/local/     localhost/USRLOCAL/     rsync\_long\_args=--numeric-ids --delete-excluded --include-from=/usr/local/etc/rsync/backup-includes --exclude-from=/usr/local/etc/rsync/backup-excludes --exclude=mnt/usb-a2/.snapshots
\#backup /var/           localhost/VAR/          rsync\_long\_args=--numeric-ids --delete-excluded --include-from=/usr/local/etc/rsync/backup-includes --exclude-from=/usr/local/etc/rsync/backup-excludes --exclude=mnt/usb-a2/.snapshots
\#backup /opt/           localhost/OPT/          rsync\_long\_args=--numeric-ids --delete-excluded --include-from=/usr/local/etc/rsync/backup-includes --exclude-from=/usr/local/etc/rsync/backup-excludes --exclude=mnt/usb-a2/.snapshots
backup  /boot/          localhost/BOOT/         rsync\_long\_args=--numeric-ids --delete-excluded --include-from=/usr/local/etc/rsync/backup-includes --exclude-from=/usr/local/etc/rsync/backup-excludes --exclude=mnt/usb-a2/.snapshots

...which yields this:

etc \# rsnapshot -c rsnapshot.conf1 -t daily

mv /mnt/usb-a2/.snapshots/daily.3/ /mnt/usb-a2/.snapshots/daily.4/
mv /mnt/usb-a2/.snapshots/daily.2/ /mnt/usb-a2/.snapshots/daily.3/
mv /mnt/usb-a2/.snapshots/daily.1/ /mnt/usb-a2/.snapshots/daily.2/
mv /mnt/usb-a2/.snapshots/daily.0/ /mnt/usb-a2/.snapshots/daily.1/
/usr/bin/rsync -aCFHAXx --numeric-ids --relative --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes \
\--exclude=mnt/usb-a2/.snapshots \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/ /. \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes \
\--exclude=mnt/usb-a2/.snapshots \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/BOOT/ /boot/ \
/mnt/usb-a2/.snapshots/daily.0/localhost/BOOT/
touch /mnt/usb-a2/.snapshots/daily.0/

BTW, according to the rsync(1) man page, --delete is implied by --delete-excluded.

Notice that, where i am using the "rsync_long_args=", i'm having to specify /all/ rsync long options except the "--link-dest" one, which means both "--{in|ex}clude-from=", and the "--exclude="$snapshot_root one, since it is not enough to assemble your "rsync_long_args=" the way you otherwise would "rsync_long_args" (the one in the config file on its own line, as contrasts with the one you add to the "backup" line)

I would've preferred this configuation (where is shown only what's different from the first one):

etc # cat rsnapshot.conf2

rsync\_long\_args         --numeric-ids --delete-excluded
backup  /               localhost/TOP/  +rsync\_long\_args=--relative
\#backup /home/          localhost/HOME/
\#backup /usr/           localhost/USR/
\#backup /usr/local/     localhost/USRLOCAL/
\#backup /var/           localhost/VAR/
\#backup /opt/           localhost/OPT/
backup  /boot/          localhost/BOOT/

...which, unfortunately, gives this:

etc \# rsnapshot -c rsnapshot.conf2 -t daily

mv /mnt/usb-a2/.snapshots/daily.3/ /mnt/usb-a2/.snapshots/daily.4/
mv /mnt/usb-a2/.snapshots/daily.2/ /mnt/usb-a2/.snapshots/daily.3/
mv /mnt/usb-a2/.snapshots/daily.1/ /mnt/usb-a2/.snapshots/daily.2/
mv /mnt/usb-a2/.snapshots/daily.0/ /mnt/usb-a2/.snapshots/daily.1/
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/media /media \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/media
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/bin /bin \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/bin
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/boot /boot \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/boot
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/dev /dev \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/dev
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/etc /etc \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/etc
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/home /home \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/home
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/lib /lib \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/lib
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
/lost+found /mnt/usb-a2/.snapshots/daily.0/localhost/TOP/lost+found
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/opt /opt \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/opt
ln /mnt/usb-a2/.snapshots/daily.1/localhost/TOP/.rsync-filter \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/.rsync-filter
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
/.rsync-filter \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/.rsync-filter
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/proc /proc \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/proc
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/root /root \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/root
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/sbin /sbin \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/sbin
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/emerge-webrsync \
/emerge-webrsync \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/emerge-webrsync
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/sys /sys \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/sys
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/tmp /tmp \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/tmp
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/usr /usr \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/usr
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/var /var \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/var
ln /mnt/usb-a2/.snapshots/daily.1/localhost/TOP/sed.gs\_prefix \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/sed.gs\_prefix
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
/sed.gs\_prefix \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/sed.gs\_prefix
ln /mnt/usb-a2/.snapshots/daily.1/localhost/TOP/sed.gs\_user\_root\_suffix \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/sed.gs\_user\_root\_suffix
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
/sed.gs\_user\_root\_suffix \
/mnt/usb-a2/.snapshots/daily.0/localhost/TOP/sed.gs\_user\_root\_suffix
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes --relative \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/TOP/GNUstep \
/GNUstep /mnt/usb-a2/.snapshots/daily.0/localhost/TOP/GNUstep
/usr/bin/rsync -aCFHAXx --numeric-ids --delete-excluded \
\--include-from=/usr/local/etc/rsync/backup-includes \
\--exclude-from=/usr/local/etc/rsync/backup-excludes \
\--link-dest=/mnt/usb-a2/.snapshots/daily.1/localhost/BOOT/ /boot/ \
/mnt/usb-a2/.snapshots/daily.0/localhost/BOOT/
touch /mnt/usb-a2/.snapshots/daily.0/

...where, as you see, there is an invocation of rsync for each file under "/". In addition i end up with /bin/bin/, /etc/etc/, /sbin/sbin/, and so on.

I have also tried this variation, which does away with the "+" prefix to "rsync_long_args=", but with the same result:

etc \# cat rsnapshot.conf3

rsync\_long\_args         --numeric-ids --delete-excluded
backup  /               localhost/TOP/  rsync\_long\_args=--numeric-ids --relative --delete-excluded
\#backup /home/          localhost/HOME/
\#backup /usr/           localhost/USR/
\#backup /usr/local/     localhost/USRLOCAL/
\#backup /var/           localhost/VAR/
\#backup /opt/           localhost/OPT/
backup  /boot/          localhost/BOOT/

Which gives the same result as the previous (the second) one. Notice also that here i don't get the --{in|ex}clude-from- options, nor the --exclude=$snapshot_root for the first backup line (that of "/").

I don't care much for the stripping of the trailing slash of the source dir; as you must know, it is not trivial to rsync. Why not use the same rule as that of rsync, and simply pass it the source dir as specified ? Where "file" means "take this file, and if it is a directory, then bring all that it contains along"; and "file/" means "we bring the contents of this directory, but not itself".
Besides, one could argue that "/" has a trailing slash, so why treat it differently than "file/" ?

[Bug] Exit if cmd_preexec fails [sf#5]

*Reported by anonymous on 2007-06-03 15:11 UTC
I do backups on a linux machine that connects via preexec and smbmount (mounting on /mnt) to windows machines.
If for some reason the connection fails (e.g. the windows machine is off), rsnapshot still processes a backup for the empty folder "/mnt". Therefore an 'empty' backup is done.
I would appreciate very much the introduction of a further parameter that controls the execution of rsnapshot if preexec fails.

[Bug] Per-backup-point parameters clobber global exclude parameters [sf#19]

Reported by resplin on 2010-01-30 18:10 UTC
System: Ubuntu Karmic 9.10
Version: 1.3.0-2

Environment

I have an exclude file that contains a list of file types that I want to exclude from backup. For one of my backup paths, I also list a subdirectory to exclude.

Here are the relevant parts of my rsnapshot.conf:
exclude_file /etc/rsnapshot/exclude
backup /home/myuser mylaptop/ exclude=NoBak
backup /home/otheruser mylaptop/

Here is the relevant line from the exclude file:
/**/*.vdi

Expected Behavior

I would expect .vdi files to be excluded from all backup paths, and the NoBak
directory to be excluded in /home/myuser.

Observed Behavior

Though the NoBak subdirectory in /home/myuser is excluded from the backup, .vdi files are being included. However, .vdi files in /home/otheruser are not being included.

Other Information

rsync behaves appropriately when it is handed both a --exclude and --exclude-from flag.

I quickly went through the exclude and exclude_file areas of the rsnapshot Perl script, and the error was not obvious to me. It seemed like the rsync command line was being built correctly with the ".=" operator.

[Bug] rsync 3.0.x does not delete content with -x / one_fs 1 [sf#32]

Reported by simix on 2011-09-08 06:10 UTC
Running rsnapshot with -x or "one_fs 1" does possibly not delete content on the snapshot directory which it would have deleted with rsync 2.x.
In our situation we are doing all snapshots with "one_fs 1". I realized the problem after a directory /var/opt has been moved to its own filesystem and a new entry has been made in rsnapshot do backup it. The problem is that the content under /var/opt/ still exists in the /var snapshot, which I excpected it should have been removed. Note that this has always worked as expected with rsync 2.x.
For more info on the issue, see here:

https://bugzilla.redhat.com/show\_bug.cgi?id=735981
https://lists.samba.org/archive/rsync/2011-September/026766.html

Thanks,
Simon

[Bug] add rsync's iconv parameter for single backup lines [sf#27]

*Reported by anonymous on 2010-12-23 19:51 UTC
My rsnapshot backupserver has UTF8 and i have to backup machines with UTF8 and ISO encodings.
So it would be nice if one can define rsync's iconv parameter for the needed backup lines in the config
like its possible with the exclude parameter.

For testing i added "--iconv=UTF-8,ISO-8859-15" to rsync_long_args. But this fails if the rsync version is to
old on some machines (pre 3.0.x) or there are machines that use already UTF8

[Bug] 'sync_first' problem with first backup [sf#8]

Reported by hzo on 2007-10-15 20:58 UTC
Objective:
I have set up new directory into which rsnapshot shall send its backups. Let's call this directory "/media/md0/rsnapshot".

I have set 'sync_first 1' in rsnapshot.conf.

Now when I'm running rsnapshot for the first time, rsnapshot is aborting with an error message:

<<<
root@box:/media/md0# rsnapshot -V sync
/bin/cp -al /media/md0/rsnapshot/hourly.0
/media/md0/rsnapshot/.sync

rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot -V sync

ERROR: gnu_cp_al() needs a valid directory as an argument
ERROR: Error! cp_al("/media/md0/rsnapshot/hourly.0", "/media/md0/rsnapshot/.sync")
...
<<<

Rsnapshot is trying to copy "hourly.0" to ".sync". But since this is the first backup run "/media/md0/rsnapshot" is still completely empty. There isn't a "hourly.0" directory in "/media/md0/rsnapshot".

I can avoid that error message by creating an empty ".sync" directory or an empty "hourly.0" directory in my backup directory "/media/md0/rsnapshot/".
Now my first backup into that directory is working.

Probable solution:
rsnapshot shouldn't try to copy "hourly.0" to ".sync" if there is no "hourly.0" directory available. Instead in this case (first run) rsnapshot should quietly create ".sync".

[Bug] rsnapshot as non-root can't delete read-only dirs [sf#12]

Reported by hashproduct on 2009-11-21 12:00 UTC
If rsnapshot is run as a non-root user with "cmd_rm" enabled (as it is in the default configuration), the "rm" will fail to delete non-empty directories whose read-only permissions were preserved from the source.

The possible fixes are:

  • Enable --fake-super so that the destination directories aren't actually set read-only.
  • Use a deletion tool smart enough to make directories writable, such as the Perl "rmtree" that rsnapshot uses when "cmd_rm" is disabled or my "rsyncrm" script.

We should make a recommendation in the documentation and consider changing the default configuration to benefit users who run rsnapshot as non-root.

https://sourceforge.net/mailarchive/message.php?msg\_name=1226951817.2592.9.camel%40mattlaptop2.local
https://sourceforge.net/mailarchive/attachment.php?list\_name=rsnapshot-discuss&message\_id=1216750202.3774.76.camel%40localhost&counter=1
rsyncrm: http://lists.samba.org/archive/rsync/2007-November/019050.html

[Patch] Additive per-backup args, auto-exclude snapshot home [sf#1]

Reported by bharat on 2004-07-12 04:36 UTC
Sorry to ship you two patches in one. I can split them
into two if you want.

Patch #1:
Added the ability for you to specify per-backup args of
the form:

+key=arg arg arg,+key2=arg arg arg

eg:
+rsync_long_args=--exclude=/dev/**,
+rsync_short_args=-a

This will add to the existing args instead of
overwriting them. Useful in keeping your per-backup
args short and sweet.

Patch #2:
Detect whether the current mount point contains the
snapshot root, and if so generate an --exclude line
specifically for that directory so that we don't back
up the snapshots

Patch #2 requires patch #1 in order to function, since
it uses the additive arguments.

The patch is against the latest anonymous CVS at the
time of this posting. Let me know if you want me to
submit it differently.

[Bug] "make test" fails in CVS version - need empty file [sf#21]

Reported by wsnyder2 on 2010-02-26 15:14 UTC
With head CVS I get

t/configtest.............................----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
./rsnapshot -c t/support/etc/configtest.conf configtest

ERROR: t/support/etc/configtest.conf on line 5:
ERROR: backup
/nfs/users/wsnyder/SandBox/rsnapshot-cvs2/rsnapshot/t/support/files/a/
localhost/ - Source directory
"/nfs/users/wsnyder/SandBox/rsnapshot-cvs2/rsnapshot/t/support/files/a/"
doesn't exist

I think all that is needed is to

touch t/support/files/a/placeholder

and add it to CVS, so that the otherwise empty directory will still get created.
The test then passes.

Thanks

[Bug] 1 level with 1 retain and sync_first makes level.1 [sf#34]

Reported by pepa65 on 2012-06-03 08:18 UTC
A configuration with a single backup-level with retain=1 and sync_first=1 will retain a 2 copy, and fail in future calls.

In rsnapshot.conf the only retain line:
retain level 1
sync_first 1

Calls:

  1. rsnapshot sync -> .sync created
  2. rsnapshot level -> level.0 created
  3. rsnapshot sync -> .sync created
  4. rsnapshot level -> level.1 created [unexpected]
  5. rsnapshot sync -> .sync created
  6. rsnapshot level -> Error: could not rename level.0 to level.1

In call 4 it should have just moved .sync to level.0

[Bug] Exit if cmd_{pre,post}exec fail [sf#36]

Reported by jasperla on 2012-06-15 07:56 UTC
Currently rsnapshot will just continue trying to do it's thing, even if cmd_{pre,post}exec fail for whatever reason. This can be quite nasty in case the
preexec script is meant to mount the target filesystem for example.

This patch adds support for cmd_preexec_error and cmd_postexec_error, a boolean variable.

[Bug] cp_al fails if it doesn't have enough permissions [sf#26]

Reported by haree on 2010-11-07 23:09 UTC
Hello, I use rsnapshot mainly for backups of webhosting data files and sometimes happens that the user doesn't know enough about privileges and changes privileges to u-x on some folder. Then rsnapshot grabs the folder with rsync and next time it runs it fails on cp_al, because it doesn't have enough privileges to copy hourly.0 to hourly.1

Now it is extremely easy to stop all backups by simply running mkdir /var/www/not-accesible && chmod a-x /var/www/not-accesible

Quick solution is to run a script before update which adds chmod u+x to all folders.

pre-backup-script / post-backup-script

Reported by firestrike on 2004-07-08 23:01 UTC
add the possibility to have a script executed prior to
and after the backup.

that way you could stop services, close open files and
only have a minimum downtime.

[Bug] Bug in 1.3.1 handling of include_conf backticks [sf#37]

Reported by rich123 on 2014-04-23 16:01 UTC
There is a bug in rsnapshot v 1.3.1 in the handling of backticks on the "include_conf" directive.

The backticks from the rsnapshot .conf file are being passed along to the shell as part of the exec of the file in backticks, resulting in the shell attempting to interpret the output from the program, instead of rsnapshot interpreting the output.

This attached patch to 1.3.1 fixes the issue.

[Patch] adds lazy delete capabilities to rsnapshot [sf#3]

Reported by rwjblue on 2005-03-25 22:03 UTC
This patch creates the ability to have rsnapshot delete
the oldest snapshot in the background after the main
backup has occured. A config file option named
"use_lazy_deletes" has been created to allow this
functionality. Please note that this is turned off by
default.

[Bug] sync_first, link_dest and multiple backup points [sf#3]

Reported by misterbryan on 2007-01-24 17:06 UTC
I am using rsnapshot to backup four directories using the "link_dest 1" option in the config file. I noticed that only the first of the four directories was actually having links created for unchanged files. My 4 backup points are listed as follows:

backup /home/ localhost/
backup /etc/ localhost/
backup /usr/local/ localhost/
backup /var/ localhost/

However, in each snapshot directory, files that have not changed and are not in /home/ have only one link when 'stat' is called on them. Furthermore, the log file shows the following:

[24/Jan/2007:04:01:11] /usr/bin/rsnapshot sync: started
[24/Jan/2007:04:01:11] Setting locale to POSIX "C"
[24/Jan/2007:04:01:11] echo 25954 > /var/run/rsnapshot.pid
[24/Jan/2007:04:01:11] mkdir -m 0755 -p /backup/.sync/
[24/Jan/2007:04:01:11] /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --exclude=/var/tmp --exclude=/var/cache --link-dest=/backup/daily.0/localhost/ /home /backup/.sync/loc
alhost/
[24/Jan/2007:04:23:04] /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --exclude=/var/tmp --exclude=/var/cache /etc /backup/.sync/localhost/
[24/Jan/2007:04:24:39] /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --exclude=/var/tmp --exclude=/var/cache /usr/local /backup/.sync/localhost/
[24/Jan/2007:04:24:39] /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --exclude=/var/tmp --exclude=/var/cache /var /backup/.sync/localhost/
[24/Jan/2007:04:28:25] touch /backup/.sync/
[24/Jan/2007:04:28:25] rm -f /var/run/rsnapshot.pid
[24/Jan/2007:04:28:25] /usr/bin/rsnapshot sync: completed successfully

So, clearly --link-dest is only being called when syncing the first backup point. I can see on line 3231 of rsnapshot that it checks if $sync_dir_was_present before adding --link-dest to the command line. After putting a debug line in there it is clear that that is where it is failing, however I am not sure what the best way to fix it is. It is clear that you don't want to use --link dest if you call sync multiple times, but you do want to use it if you have multiple directories to be backed up in the same sync.

Version info:
rsnapshot 1.2.9
running under Perl version 5.8.8.
opensuse 10.2
cp (GNU coreutils) 6.4
rsync version 2.6.8 protocol version 29

--
Josh Bryan
[email protected]
www.joshbryan.com

[Bug] print_cmd should quote shell-special characters [sf#17]

Reported by hashproduct on 2009-11-27 21:18 UTC
Currently, print_cmd simply joins the arguments of the command with spaces. It should quote characters that have special meaning to the shell so that the displayed command (1) is an accurate representation of what is being executed and (2) works when pasted into a shell for debugging. See https://sourceforge.net/mailarchive/forum.php?thread\_name=alpine.DEB.2.00.0911262216230.1872%40work.Belkin&forum\_name=rsnapshot-discuss .

[Bug] rsnapshot du fails if snapshot root path contains a space [sf#7]

Reported by semente on 2007-09-26 03:25 UTC
$ sudo rsnapshot du
Password:
/usr/bin/du: cannot access /media/Storage': No such file or directory /usr/bin/du: cannot access disk/semente/var/cache/rsnapshot/hourly.0/': No such file or directory
/usr/bin/du: cannot access /media/Storage': No such file or directory /usr/bin/du: cannot access disk/semente/var/cache/rsnapshot/hourly.1/': No such file or directory
/usr/bin/du: cannot access /media/Storage': No such file or directory /usr/bin/du: cannot access disk/semente/var/cache/rsnapshot/hourly.2/': No such file or directory
/usr/bin/du: cannot access /media/Storage': No such file or directory /usr/bin/du: cannot access disk/semente/var/cache/rsnapshot/hourly.3/': No such file or directory
0 total
Error while calling /usr/bin/du.
Please make sure this version of du supports the "-csh" flags.
GNU du is recommended.

$ grep Storage /etc/rsnapshot.conf
snapshot_root /media/Storage disk/semente/var/cache/rsnapshot/

[Patch] Lazy delete removes foreign lock file [sf#10]

Reported by simix on 2010-10-11 05:56 UTC
Today I saw this in my logs:

echo 10161 > /var/run/rsnapshot.pid
mv /home/snapshots/weekly.3/ /home/snapshots/_delete.10161/
mv /home/snapshots/weekly.2/ /home/snapshots/weekly.3/
mv /home/snapshots/weekly.1/ /home/snapshots/weekly.2/
mv /home/snapshots/weekly.0/ /home/snapshots/weekly.1/
mv /home/snapshots/daily.6/ /home/snapshots/weekly.0/
rm -f /var/run/rsnapshot.pid
/bin/rm -rf /home/snapshots/_delete.10161
rm -f /var/run/rsnapshot.pid

Obviously the lockfile is removed twice, which ist clearly wrong because the seconds lock is a foreign one!
Attached patch should prevent this from happening.

[Patch] Ignore lockfile in test mode [sf#5]

Reported by simix on 2009-08-18 06:24 UTC
I tried to test what would be done if I call 'rsnapshot -t sync gw-04'. Because an rsnapshot process was already running the test call gave me this error:

rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot -t sync gw-04

ERROR: Lockfile /var/run/rsnapshot.pid exists and so does its process, can not continue

Attached patch against 1.3.1 fixes this behavior by ignoring existing lock files in test mode.

Allow rsync to remote host (not just from)

Reported by neuhaus on 2004-01-07 13:34 UTC
I don't really trust the backup server because multiple
people use it. So I don't want to rsync from the backup
server to my server.

Feature request:
Modify rsnapshot so it can

  • do "cp -al" via SSH on the backup server (command
    sent from my server)
  • do rsync to the backup server from my server

[Patch] Patch with non --relative comments [sf#8]

Reported by wsnyder2 on 2010-02-26 17:07 UTC
I had to dig through the code before I realized that I could remove the --relative to obtain the naming I wanted. This clarifies it a bit.

Please confirm that using . in the backup command won't cause odd behavior... it seems to work.

Thanks

[Bug] 1.3.1 - t fails to show --link-dest when only one snapshot i [sf#10]

Reported by libertytrek on 2009-02-04 13:44 UTC
When only one snapshot is present (ie, daily.0), if rsnapshot -t is run, it does not show that --link-dest will be used.

Not a show-stopper obviously, but I did spend more than a few minutes trying to figure out why my remote mounted nfs filesystem apparently didn't support hardlinks...

:)

Thanks so much for rsnapshot, it is an awesome utility!

[Bug] "exclude" param should bypass split_long_args_in_quotes [sf#18]

Reported by hashproduct on 2009-11-27 21:27 UTC
"exclude" parameters are currently translated to additional arguments in the "rsync_long_args", which means they are subject to word splitting by split_long_args_with_quotes. I can't think of any case in which the splitting would be useful, and it causes needless pain when specifying an exclude pattern containing a space. The excludes should be contributed directly as an array of arguments without going through split_long_args_with_quotes. See https://sourceforge.net/mailarchive/forum.php?thread\_name=1259187611.2009.366.camel%40mattlaptop2.local&forum\_name=rsnapshot-discuss .

[Bug] native_cp_al as non-root can't handle read-only dirs [sf#13]

Reported by hashproduct on 2009-11-21 12:12 UTC
When rsnapshot is running as root, native_cp_al can't copy nonempty read-only dirs because it creates the destination dirs read-only too and is then unable to put files in them. native_cp_al is used when "link_dest" is off and "cmd_cp" is disabled, as well as in some more exotic cases. sync_cp_src_dest may have the same issue. See https://sourceforge.net/mailarchive/message.php?msg\_name=4886426C.9050907%40free.fr for a patch.

As an alternative to fixing native_cp_al, we could try to replace it with something rsync-based; on this topic, see https://bugzilla.samba.org/show\_bug.cgi?id=5665 .

[Bug] Use of uninitialized value $linux_lvm_oldpwd [sf#31]

Reported by calumlind on 2011-07-25 21:11 UTC
I am running rsnapshot 1.3.1 on Ubuntu Maverick using lvm snapshots. When I ran rsnapshot from the console for the first time "sudo rsnapshot hourly" it seems to be working fine but I got this error in console upon completion:

Use of uninitialized value $linux_lvm_oldpwd in concatenation (.) or string at /usr/bin/rsnapshot line 3720.
Use of uninitialized value $linux_lvm_oldpwd in chdir at /usr/bin/rsnapshot line 3722.
Use of chdir('') or chdir(undef) as chdir() is deprecated at /usr/bin/rsnapshot line 3722.
Logical volume "rsnapshot" successfully removed

It seems to be related to running it with sudo as logging into root console did not return that error.

[Bug] make test fails if in a symlinked directory [sf#9]

*Reported by anonymous on 2008-05-27 14:52 UTC
If the tarball is unzipped to a path where one of the parents is a symlink, "make test" won't run correctly.

OS X 10.5. I've installed gnu cp and rsync 2.6.9 via fink. Here's the error I get:

Nooch:rsnapshot-1.3.1 leon$ make test
/usr/bin/perl -MTest::Harness -e 'runtests(glob "t/*.t")';
t/configtest................ok
t/gnu_cp....................rsync: recv_generator: mkdir "/Users/leon/download/rsnapshot-1.3.1/t/support/snapshots/hourly.0/localhost/Users/leon/download/rsnapshot-1.3.1" failed: No such file or directory (2)

Investigating, I find that /Users/leon/download/rsnapshot-1.3.1/t/support/snapshots/hourly.0/localhost/Users/leon/download
is a symlink to /Users/leon/Desktop/Download, which is the true location of /Users/leon/download. It can't create rsnapshot-1.3.1 there because it already exists.

If I instead go to /Users/leon/Desktop/Download/rsnapshot-1.3.1, I can run the tests just fine.

[Bug] include_conf checks sanity on every config file [sf#4]

Reported by felmasper on 2007-03-06 21:57 UTC
Every config file read by parse_config() function is checked for sanity. I want to put in rsnapshot-myhost.conf:

include_conf /etc/rsnapshot-common.conf
backup ... ...
backup ... ...

But, as include_conf parses rsnapshot-common.conf, it aborts saying I don't have backup points. In fact, I have them, but they are still to be read when "include_conf rsnapshot-common.conf" returns.

I'm really newbie in perl. I'm trying to isolate the check_config_sanity code and to call it only once after all config was read. No success.

[Bug] Protect against attribute tweaking [sf#14]

Reported by hashproduct on 2009-11-21 12:32 UTC
When rsnapshot runs rsync on a destination that already contains files hard-linked from a previous snapshot, rsync may tweak the attributes of those files, effectively corrupting the attributes as seen via the previous snapshot. This can happen in two scenarios: (1) when link_dest is off and (2) when retrying a backup with sync_first.

My proposed --no-tweak-hlinked rsync option ( https://bugzilla.samba.org/show\_bug.cgi?id=4561 ) is designed specifically to address this problem, but the implementation is out of date with the current rsync. In the absence of --no-tweak-hlinked, nothing can be done about scenario 1 (other than enabling link_dest), while --ignore-existing is a decent alternative for scenario 2. See https://sourceforge.net/mailarchive/message.php?msg\_name=1201753719.7077.44.camel%40localhost .

[Patch] Patch to sync_first to not roll back if failed [sf#9]

Reported by phihoi on 2010-09-28 20:12 UTC
When the sync_first option is used the rsnapshot behaviour is to rollback backups when the backup failed. I feel that the correct behaviour should be that the backup should not be rolled back on a failed synchronization, rather the rsync should continue where it was left off on the next iteration.

This patch increases the reliability of rsnapshot when used over bad links, the backup will eventually complete and rotate, when done. Without this patch failed backups creates a risk of failed backups and lost data if the failure happens over a longer period of time.

I use rsnapshot like this:

bash# rsnapshot sync && rsnapshot daily

I.e. Only rotate if the sync completes successfully. Rsnapshot will continue the next day if it failed.

--
Philippe

[Patch] Changed "check for directory" condition [sf#12]

*Reported by anonymous on 2011-05-18 20:38 UTC
With rsnapshot on Ubuntu 10.04, running with sync_first, I would get the error message "rsync_cleanup_after_native_cp_al() only works on directories", because my directory strings don't end with slashes. Changing the if-clause that checks for directories fixed that.

[Bug] Dangling symlinks cause rsnapshot to bail [sf#1]

Reported by bharat on 2004-07-05 06:07 UTC
I just installed the latest rsnapshot on my Debian box
using your debian package 1.1.5-1. I've got some
dangling symlinks in a directory I'm trying to back up
and when I run rsnapshot it tells me:

ERROR: Could not understand source "/initrd.img.old" in
backup_interval()

I worked around this by changing the bail() call to
print_warn() instead, but I'm not sure what the long
term implications are of doing this (haven't even tried
to run it like this outside of test mode yet).

[Patch] Edits to appease emacs [sf#7]

Reported by wsnyder2 on 2010-02-26 15:37 UTC
The attached minor patch fixes a syntax highlighting issue in Emacs 21.4, and fix the tabs to look as I think you intended.

[Bug] Document the minimum required rsync version [sf#23]

Reported by hashproduct on 2010-03-07 05:52 UTC
Prominently document the minimum required rsync version. This is especially important if we remove workarounds for bugs in old versions of rsync. The minimum version should also be added to the "Requires" in the RPM spec file.

[Patch] Fix for ssh args [sf#2]

Reported by bharat on 2004-07-12 08:34 UTC
I tried specifying an ssh identity file using ssh_args
and found that the args weren't associated with the ssh
command because the whole --rsh argument must be in quotes.

The old way would generate:
... --rsh=/usr/bin/ssh -i
/root/.ssh/parity-backups-var.dsa ...

with my patch it generates:
--rsh="/usr/bin/ssh -i /root/.ssh/parity-backups-var.dsa"

(I have individual ssh keys for each partition I want
dumped so that I can force the operation to get at
least some security).

[Bug] Space in destination path in rsnapshot.conf [sf#29]

Reported by guikcd93 on 2011-03-15 20:33 UTC
Hello,

A Debian user reported 1 that if the destination path in rsnapshot.conf contains a space, the backup fails.
The patch at 2 fix the issue by removing the backslash get in configuration file and let mkpath handle the path correctly.

[Bug] rsnapreport.pl throws warnings [sf#6]

Reported by prfxnst on 2007-08-31 18:03 UTC
I've configured the cron job for rsnapshot (v. 1.3.0-1) to pipe verbose output (verbose 3 in rsnapshot.conf) to rsnapreport.pl ...

30 23 * * * /usr/bin/rsnapshot daily 2>&1 | /usr/bin/rsnapreport.pl | mail -s"[RSNAPSHOT] daily report" [email protected]

The report is created, but cron reports separately...

Use of uninitialized value in formline at /usr/bin/rsnapreport.pl line 53.

...for every mount point being backed up.

[Bug] link_dest 1 doesn't create hardlinks (ext4 -> NTFS) [sf#28]

Reported by przepiorkowski on 2010-12-24 10:17 UTC
When creating a backup of ext4 directories to an NTFS external drive, hardlinks are not created (instead, full copies are made) when "link_dest" is set to 1.

This is probably an rsync problem, but even if so, maybe an explicit warning should be given somewhere in rsnapshot documentation.

More details:

- system: Ubuntu 10.10 (Maverick Meerkat) with ext4 partitions

  • external drive: NTFS-preformatted, mounted from fstab like this:

UUID=FA7AA76F7AA726FB /media/MyBook ntfs-3g defaults,uid=1000,gid=1000,utf8,dmask=027,fmask=137,nodev 0 0

- rsnapshot and rsync versions: default for this distro of Ubuntu, i.e.:

$ rsnapshot --version
rsnapshot 1.3.1
$ rsync --version
rsync version 3.0.7 protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes

- problem description:

With "link_dest 1" further backups take hours and lots of diskspace; no hardlinks is confirmed by:

$ for i in 0 1; do ls -i /media/MyBook/.BACKUP/hourly.$i/path/to/specific/file; done

showing different inodes. With "link_dest 0" further backups take minutes and almost no diskspace; hardlinks are confirmed by:

$ for i in 0 1; do ls -i /media/MyBook/.BACKUP/hourly.$i/path/to/specific/file; done
293477 /media/MyBook/.BACKUP/hourly.0/path/to/specific/file
293477 /media/MyBook/.BACKUP/hourly.1/path/to/specific/file

[Bug] preliminary delete of <interval>.delete dir [sf#2]

Reported by jpo38 on 2006-08-29 12:40 UTC
For rsnapshot VERSION = '1.2.9'

It seems the path is wrong line 2618:
:> $result = rm_rf(
"$config_vars{'snapshot_root'}/$$id_ref{'interval'}.delete/"
);
It should be:
:> $result = rm_rf(
"$config_vars{'snapshot_root'}/$interval.delete/" );

-----------

Moreover, I am not sure deleting other .delete dir
other than current interval is good.

when use_lazy_deletes=1 and when backup is large
the delete operation may take time (especially USB
drive)

So, for example, when daily is started , the rm
command for the weekly may not
be completed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.