I am using rsnapshot
to manage my backups. The file /home/foo/bar
is a symbolic link to a folder, and I want to exclude it. The --exclude
option does not work, because if the pattern ends with a /
then it will only match a directory, not a symlink.
How could I do this?
The rsync
man page says:
if the pattern ends with a
/
then it will only match a directory, not a regular file, symlink, or device.
So what I'm asking is: how can I exclude from rsnapshot
a symbolic link to a folder?
If the link is /home/foo/bar
, which of the following config lines is the right one?
exclude /home/foo/bar/
exclude /home/foo/bar
exclude /home/foo/bar**
exclude /home/foo/bar***
This is the config file that I'm using now:
config_version 1.2
snapshot_root /media/satellite/rsnapshot/
cmd_cp /bin/cp
cmd_rm /bin/rm
cmd_rsync /usr/bin/rsync
cmd_logger /usr/bin/logger
retain hourly 6
retain daily 7
retain weekly 4
verbose 2
loglevel 3
lockfile /var/run/rsnapshot.pid
exclude /home/roberto/media/
exclude /home/roberto/media
exclude /home/roberto/media**
exclude /home/roberto/media***
backup /home/ localhost/
backup /etc/ localhost/
backup /usr/local/ localhost/
backup /var/www/ localhost/
Where /home/roberto/media
is a symlink to /media
, which is a directory
--exclude=/bar
(assuming that your source is/home/foo
)?