I have backed up a linux web server using rsync with cygwin. I now have a perfect copy of the server on my windows laptop. If i delete or modify a file on my laptop and run rsync again with cygwin will it delete/update the same file on the server? Im under the impression that if i delete/modify on the server and run rsync on my laptop it will delete/modify the local file on my laptop but does this work in reverse?
Rsync does a one way sync, however it's up to you to decide which way the sync goes.
Rsync command syntax is the following:
Note that you specify sync from source to destination. Source and destination can be any local or remote path.
For example if you want to copy files from your server to your laptop you do:
To sync in the opposite direction you do:
So to answer your question: it depends on how you execute rsync.
If you want files to be deleted on the destination you need to use
As suggested by masegaloeh in comments below,
A wrapper tool written in python3 called
Don't be scared when it is on github (i.e. in a way that you think you must be a programmer to use the tool).
consider using --delete-after and not --delete, this will ensure that your receiving end will delete files after transfer, not before.