Help: Make 2 Dirs Identical

Justin T Pryzby justinp at norchemlab.com
Sun Feb 10 08:54:41 MST 2013


If you really want to exclude /vault/test1/ccc, and for /vault/test2
to end up at /store/test2, then I would suggest:

rsync -avz --exclude /test1/ccc src:/vault/ dest:/store
rsync -avz src:/vault/test2 dest:/store

that runs rsync over ssh.

Note that the trailing slash on the "src" argument in the first
command is significant.

You may also want to run with --del (for delete).

Justin

On Sun, Feb 10, 2013 at 11:24:38PM +0800, Lee Eric wrote:
> Hi,
> 
> I have 2 servers. One is data source I call is SRC and another one is
> for DEST data receive, DEST. Here's what I need to accomplish:
> 
> SRC:
> 
> dir: /vault/test1
> file: /vault/test1/aaa
> file: /vault/test1/bbb
> file: /vault/test1/ccc
> dir: /vault/test2
> 
> DEST:
> 
> dir: /store
> file: /store/xxx
> 
> ======>
> 
> Final Result:
> 
> DEST:
> 
> dir: /store
> dir: /store/test1
> file: /store/test1/aaa
> file: /store/test1/bbb
> dir: /store/test2
> 
> Could anyone tell me how to accomplish that?
> 
> Thanks very much.
> 
> Eric
> -- 
> Please use reply-all for most replies to avoid omitting the mailing list.
> To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
> 


More information about the rsync mailing list