How rsync works
Hi all,
I would like to ask your help as I try to understand how rsync works. I was syncing some files to an external hard disk ($MOUNTPOINT) with the following line (runs through crontab) Code:
rsync -rav -e ssh lka@server:/storage/disk1/ $MOUNTPOINT I then checked my files on my external hard disk ($MOUNTPOINT) and all the files were still there. I was expecting (and luckily that did not happen) rsync to sync the empty folder to the external hard disk ($MOUNTPOINT). Of course that would mean "deleting" the files ... Can someone explain me why this did not happen? I would like to thank you in advance for your reply Regards Alex |
there are a few options to rule how and when should rsync delete those files, see man page and --delete* options
(you are lucky because the default is to avoid deleting files) |
There is an option to rsync to also delete files (--delete). If that is not given rsync only copies files from source to destination. So if there are no source files nothing gets copied. There is also an option to reverse delete so files that are not on destination are deleted on the source side.
I'd just say you give the man page a read. Its quite long so maybe read it once for an overview and a second time for each option there is. |
check out this link: https://calomel.org/rsync_tips.html
from link above: Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
All times are GMT -5. The time now is 08:45 AM. |