Firstly, I have a hard time understanding what the
--update parameter does. I thought that without it, it would logically update any file that changes and I believe that's what it does, so why does the
--update parameter even exist?
Secondly, related to what I asked because I thought it would solve my issue, but it doesn't, I have a bunch of config files that I would want updated into a different folder every time they change by having a cronjob that runs the below command every hour or every day, this way I can have a few previous versions in case something goes awry. The problem is that these files rarely change, but rsync creates another folder with hard links regardless it changes or not, which is a bit annoying because then you have loads of folders of the same thing, even them being a hard link and not taking space, it creates a lot of clutter.
Isn't there any way to stop rsync --link-dest from doing this? That is, create the folder only if anything changes, otherwise do nothing. Seems like a pretty basic case scenario so I would have thought there is an easy way to do this with a parameter, but I can't find the answer anywhere.
rsync -azP --delete --stats --update --log-file=/var/log/rsync/apacheconfdate +%F_%T
.log -e "ssh -i /home/user/.ssh/id_rsa" /etc/apache2/sites-available --link-dest=/mnt/backup/apache2/apache firstname.lastname@example.org:/mnt/backup/apache2/apachedate +%F_%T