How to let rsync only copy over the directories on destination side? - Networking

This is a discussion on How to let rsync only copy over the directories on destination side? - Networking ; Hi, Here is how I am using rsync to copy some large file set remotely: rsync -azv --delete /remote_dir/ . The problem is there are a lot of sub-directories I do not need, so each time after the rsync is ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to let rsync only copy over the directories on destination side?

  1. How to let rsync only copy over the directories on destination side?

    Hi,
    Here is how I am using rsync to copy some large file set remotely:

    rsync -azv --delete /remote_dir/ .

    The problem is there are a lot of sub-directories I do not need, so
    each time after the rsync is done, I need to manually trim them away.

    Is there a way to tell rsync only to copy over the sub directories
    which are under the destination path?

    What I mean is, let us say here are the source and destination
    directory trees:

    src_tree: /remote_dir/1, /remote_dir/2, /remote_dir/3
    dst_tree: ./1, ./3/33

    I only want to copy over 1/ and 3/33/, not 2/ and any other sub-
    directories under 3/.

    Thanks.


  2. Re: How to let rsync only copy over the directories on destination side?

    linq936@hotmail.com wrote:
    > Here is how I am using rsync to copy some large file set remotely:
    > rsync -azv --delete /remote_dir/ .


    No it's not. Come back with (an illustration of) the real command.


    > The problem is there are a lot of sub-directories I do not need, so
    > each time after the rsync is done, I need to manually trim them away.


    > Is there a way to tell rsync only to copy over the sub directories
    > which are under the destination path?


    Read the manual page for the -a flag.

    Chris

+ Reply to Thread