rsync deletes original directory

Hi

I have a strange problem. Sometimes when I execute the below command something wierd happens.

rsync -avz -e ssh travegre@travegre.net: ../travegre.net/

the folder named "hm" that is held in travegre.net and is coppied along with all the other folders and data at travegre.net, gets deleted or better yet, the name of the folder is still there but is changed to "hm@" as a link which points to nothing. When I looked at the output of rsync the last time this happened (it doesn't happen on every run of rsync but has happened many times now) I found this strange:

rsync: delete_file: rmdir "/home/travegre.net/hm" failed: Directory not empty (39)

"/home/travegre.net/" is the directory to which I copy files, so I don't understand why rsync would want to delete it at any point, moreover, why delete only the directory "hm" and above all, why all this problems always just with this directory, as if it was special in some way? But in the end, as I said, the directory in the destination is intact and the one in the source server gets ruined.

This problem has been bugging me for long time and I didn't find any answer on the web so if someone has any idea or a hint as to solution to this problem I would be very grateful, also tell me if I have to post this question somewhere else as I'm quite new here.

Thanks in advance

Gregor Traven

That is strange.

All I can think of is rsync getting the source and destination confused.

Are you specifying any of the --delete , --delete-before, --delete-during, --delete-after options by any chance?

no, just the: rsync -avz -e ssh travegre@travegre.net: ../travegre.net/

Would it be better if I do specify one of these, would that help him get it right?:slight_smile:

You might try using an absolute instead of relative path.

Since you're mixing ssh in with that it's a bit beyond my knowledge.

thanks, i'll try