Reputation: 105
Currently I am using
rsync -avz daniel@remotepc:/var/www /home/localuser/rsync --exclude='/var/www/somefolder'"
, but if a file is deleted on remotepc, I want it to be deleted on the local copy.
I wasn't sure if --delete
was to be used here, and just wanted to check before I do something stupid and end up losing data.
Upvotes: 0
Views: 1072
Reputation: 18399
Why do you care about loosing data if you may only loose local copy? Also, rsync have -n
option, which is dry run - it will print everything it would do, but will not perform any changes.
Also, if you're too afraid losing local copy (maybe data is too large to re-download), you could use -b
option, which will rename files to filename~
instead of deleting it.
Anyway --delete
is what you need, and even maybe --delete-excluded
.
Upvotes: 1