rsnapshot
uses the --relative
flag of rsync
to preserve pathname information. In most cases, you probably do want to keep (at least some of) that information, especially when backing up local directories. However, in your case, you really don't need to keep the leading path prefix.
With reasonably recent versions of rsync
(v.2.6.7+), you can explicitly control the portion of the pathname prefix that --relative
saves by inserting a ./
at the desired cut-point. The ./
does not effectively change the pathname, but it does tell rsync
that you want --relative
to only keep the part of the pathname that follows the ./
. Since you want to cut off the entire pathname, you simply append the ./
onto the end of the source path, like this:
backup root@123.123.123.123:/mnt/rsnapshot/./ srv01/
EDIT
Okay, so it looks like the ./
trick won't work in this case, since rsnapshot
strips off the trailing /
. Instead, you should be able to disable the --relative
option on a per-backup-point basis, by adding a fourth column to your backup
line, like this:
backup root@123.123.123.123:/mnt/rsnapshot/ srv01/ +rsync_long_args=--no-relative
The +rsync_long_args
tells rsnapshot
to append to its existing rsync_long_args
option, for the current backup-point only. By appending --no-relative
to rsync_long_args
, you achieve the desired effect of turning off --relative
.