Results 1 to 5 of 5

Thread: rsync doesn't remove old folders

  1. #1
    Join Date
    Jan 2009
    Location
    Greece
    Posts
    36

    Default 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

    Code:
    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?

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: rsync doesn't remove old folders

    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.

  3. #3
    Join Date
    Jan 2009
    Location
    Greece
    Posts
    36

    Default Re: rsync doesn't remove old folders

    Quote Originally Posted by ken_yap View Post
    When in doubt, read the manual.
    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...

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: rsync doesn't remove old folders

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

  5. #5
    Join Date
    Jun 2008
    Location
    Berlin
    Posts
    2,061

    Default Re: rsync doesn't remove old folders

    Yeah, '--exclude=/.*' should do the trick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •