Re: using rsync to transfer only files and not sub-directories
On Tue, 2008-09-16 at 12:30 -0700, Meeaz wrote:[color=blue]
> I am trying to rsync contents of a directory while making sure that
> "only" files under that directory are synched and "not" the contents
> of any sub-directory under that dir. I know that I will have to use
> the include/exclude option but not sure how.[/color]
The following will copy the subdirectories themselves but not their
contents:
rsync -d SRC/ DEST/
If you don't want the subdirectories at all, do this:
rsync -d --exclude='*/' SRC/ DEST/
Matt
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: [url]https://lists.samba.org/mailman/listinfo/rsync[/url]
Before posting, read: [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url]
Re: using rsync to transfer only files and not sub-directories
Thanks. We have:-
rsync version 2.6.3 protocol version 28
Does the "-d" option work for the version above?
Thanks
Matt McCutchen-7 wrote:[color=blue]
>
> On Tue, 2008-09-16 at 12:30 -0700, Meeaz wrote:[color=green]
>> I am trying to rsync contents of a directory while making sure that
>> "only" files under that directory are synched and "not" the contents
>> of any sub-directory under that dir. I know that I will have to use
>> the include/exclude option but not sure how.[/color]
>
> The following will copy the subdirectories themselves but not their
> contents:
>
> rsync -d SRC/ DEST/
>
> If you don't want the subdirectories at all, do this:
>
> rsync -d --exclude='*/' SRC/ DEST/
>
> Matt
>
> --
> Please use reply-all for most replies to avoid omitting the mailing list.
> To unsubscribe or change options:
> [url]https://lists.samba.org/mailman/listinfo/rsync[/url]
> Before posting, read: [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url]
>
>[/color]
--
View this message in context: [url]http://www.nabble.com/using-rsync-to-transfer-only-files-and-not-sub-directories-tp19518813p19531958.html[/url]
Sent from the Samba - rsync mailing list archive at Nabble.com.
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: [url]https://lists.samba.org/mailman/listinfo/rsync[/url]
Before posting, read: [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url]
Re: using rsync to transfer only files and not sub-directories
On Wed, 2008-09-17 at 06:19 -0700, Meeaz wrote:[color=blue]
> Thanks. We have:-
>
> rsync version 2.6.3 protocol version 28
>
> Does the "-d" option work for the version above?[/color]
No, -d was added in 2.6.4. With such an old version, you'll have to use
the following if you want the subdirectories themselves:
rsync -r --exclude='*/*' SRC/ DEST/
or the following if you don't:
rsync -r --exclude='*/' SRC/ DEST/
Matt
[color=blue]
> Matt McCutchen-7 wrote:[color=green]
> >
> > On Tue, 2008-09-16 at 12:30 -0700, Meeaz wrote:[color=darkred]
> >> I am trying to rsync contents of a directory while making sure that
> >> "only" files under that directory are synched and "not" the contents
> >> of any sub-directory under that dir. I know that I will have to use
> >> the include/exclude option but not sure how.[/color]
> >
> > The following will copy the subdirectories themselves but not their
> > contents:
> >
> > rsync -d SRC/ DEST/
> >
> > If you don't want the subdirectories at all, do this:
> >
> > rsync -d --exclude='*/' SRC/ DEST/[/color][/color]
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: [url]https://lists.samba.org/mailman/listinfo/rsync[/url]
Before posting, read: [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url]