rsync doesn't remove old folders

Hello

I want to synchronize my home folder from my laptop to my desktop from the local network, but i want to transfer only the visible folders/files… So i am using the following command

rsync -v-r-e --delete ssh ~/* kokeroulis-desktop@ip_address:~/

The command is transferring the files but it doesn’t remove the old folders which they doesn’t exist any more… So what am i doing wrong?

When in doubt, read the manual.

–delete

This tells rsync to delete extraneous files from the receiving side (ones that aren’t on the sending side), but only for the directories that are being synchronized. You must have asked rsync to send the whole directory (e.g. “dir” or “dir/”) without using a wildcard for the directory’s contents (e.g. “dir/*”) since the wildcard is expanded by the shell and rsync thus gets a request to transfer individual files, not the files’ parent directory.

ok… Thank you but if i do that, then it will copy all the invisible folders/files together with the visible ones, which might cause some dysfunction to my system because some of those invisible folders are the .kde4…

So figure out some other way to do it, maybe using --exclude.

Yeah, ‘–exclude=/.*’ should do the trick.