Blinddarm
Blinddarm

Reputation: 15

rsync over ssh delete existing files

I am trying to get files from a Server on my Raspberry Pi with rsync over ssh. Right now i'm using this (it works):

rsync -avz -e ssh USER@SERVER:'/server/directory' '/traget/directory'

Files that are not on the server anymore should now be deleted on the RP. How do I do that? (--delete seems not to work)

Upvotes: 1

Views: 4795

Answers (1)

johnsyweb
johnsyweb

Reputation: 141810

You need one more option, presuming that you have permissions to delete files under /traget/directory:

     --delete                delete extraneous files from destination dirs

Also watch out for typos when executing commands that can delete files and directories!

Upvotes: 2

Related Questions