-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The only way I can think of to do that would be to use find -type d on
the target to generate a list of directories that pre-exist then use
that as an include list before an exclude of */  So, something like:

cd /destination
echo '- .git' > /tmp/filelist
find . -type d -print | sed -e 's/^./+ /' >> /tmp/filelist
echo '- */' >>> /tmp/filelist
rsync -anvi --exclude-from=/tmp/filelist --progress source/ destination/

You will notice that I changed your options a little bit...
- -t is included in -a and you will probably find -i to be more useful
than the second (or even the first) -v.  Though -vv is still useful
when debugging exclude/include.

On 11/13/2014 12:26 AM, charith wrote:
> Good day to all!
> 
> I'm doing git file replication task and need to sync source
> destination, using below sync command.
> 
> rsync -atnvv --existing --exclude '.git' --progress source/
> destination/;
> 
> Here I,
> 
> 1) need  only sync directories that *exist on destination* ,no new 
> folders should copy from source - [used  --existing did the job but
> it not copying new files also.]
> 
> 2) need to copy *new files *on source  directory to destination.
> 
> Thanks in advance Charith.
> 
> 
> 
> 
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
        Kevin Korb                      Phone:    (407) 252-6853
        Systems Administrator           Internet:
        FutureQuest, Inc.               ke...@futurequest.net  (work)
        Orlando, Florida                k...@sanitarium.net (personal)
        Web page:                       http://www.sanitarium.net/
        PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlRkQs4ACgkQVKC1jlbQAQd+KQCgwyGY2znfV/WlAbQJhZted8Kq
k7MAni1Psfd5xJUWWZRtJVqxhTigmFY8
=4XJq
-----END PGP SIGNATURE-----
-- 
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

Reply via email to