rsync to exclude a directory and its contents - Tools

This is a discussion on rsync to exclude a directory and its contents - Tools ; Does anybody know how to exclude a directory and its contents, for example I want to rsync /home/user1/dir1 but dir1 has a subdirectory subdir10 (/home/user1/dir1/subdir10) that I would like to not rsync to the remote host. I tried --exclude=/home/user1/dir1 in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: rsync to exclude a directory and its contents

  1. rsync to exclude a directory and its contents

    Does anybody know how to exclude a directory and its contents, for
    example I want to rsync
    /home/user1/dir1
    but dir1 has a subdirectory subdir10 (/home/user1/dir1/subdir10) that I
    would like to not rsync to the remote host. I tried
    --exclude=/home/user1/dir1 in all kinds of variations, then I tried
    --exclude-from and also tried the --filter switch. None worked. This
    seems like a pretty basic feature and I'm surprised I'm having hard
    time getting it to work.
    Am I missing something or there's no such feature in rsync yet?
    Thanks,
    Roumen.


  2. Re: rsync to exclude a directory and its contents

    Next time, please include version or rsync and OS.

    On solaris 8 with rsync 2.6.6,

    rsync --exclude subdir10 /home/user1/dir1 .

    should work...

    Chris

    semovrs@concord.edu wrote:
    > Does anybody know how to exclude a directory and its contents, for
    > example I want to rsync
    > /home/user1/dir1
    > but dir1 has a subdirectory subdir10 (/home/user1/dir1/subdir10) that I
    > would like to not rsync to the remote host. I tried
    > --exclude=/home/user1/dir1 in all kinds of variations, then I tried
    > --exclude-from and also tried the --filter switch. None worked. This
    > seems like a pretty basic feature and I'm surprised I'm having hard
    > time getting it to work.
    > Am I missing something or there's no such feature in rsync yet?
    > Thanks,
    > Roumen.



+ Reply to Thread