Excluding files with no extensions - windows cygwin client

View: New views
3 Messages — Rating Filter:   Alert me  

Excluding files with no extensions - windows cygwin client

by dreniarb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

using a standard rsync command line, with this as the --exclude-from file:

+ /*.pst
- *.*

While this does include only files with a .pst extension, it also includes files without an extension.  This means about 5000 files instead of just a handful.  Using the --prune-empty-dirs gets rid of the empty directories, but not the files with no extensions.  

I've tried:

+ /*.pst
- *.*
- *

and:

+ /*.pst
- *.*
- /*

and:

+ /*.pst
- *.*
- *.

but those cause no files to be copied at all, i assume because it's forcing it to exclude all directories.

So is there a way to tell rsync to ignore files with no extensions?

TIA

Re: Excluding files with no extensions - windows cygwin client

by Steven Monai-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

dreniarb wrote:

> using a standard rsync command line, with this as the --exclude-from file:
>
> + /*.pst
> - *.*
>
> While this does include only files with a .pst extension, it also includes
> files without an extension.  This means about 5000 files instead of just a
> handful.  Using the --prune-empty-dirs gets rid of the empty directories,
> but not the files with no extensions.  
>
> I've tried:
>
> + /*.pst
> - *.*
> - *
>
> and:
>
> + /*.pst
> - *.*
> - /*
>
> and:
>
> + /*.pst
> - *.*
> - *.
>
> but those cause no files to be copied at all, i assume because it's forcing
> it to exclude all directories.
>
> So is there a way to tell rsync to ignore files with no extensions?

Yes, I think so. Try this:

+ *.pst
+ */
- *

(Use with --prune-empty-dirs, of course!)

-SM
--
--
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

Re: Excluding files with no extensions - windows cygwin client

by dreniarb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Steven Monai-3 wrote:
dreniarb wrote:
> using a standard rsync command line, with this as the --exclude-from file:
>
> + /*.pst
> - *.*
>
> While this does include only files with a .pst extension, it also includes
> files without an extension.  This means about 5000 files instead of just a
> handful.  Using the --prune-empty-dirs gets rid of the empty directories,
> but not the files with no extensions.  
>
> I've tried:
>
> + /*.pst
> - *.*
> - *
>
> and:
>
> + /*.pst
> - *.*
> - /*
>
> and:
>
> + /*.pst
> - *.*
> - *.
>
> but those cause no files to be copied at all, i assume because it's forcing
> it to exclude all directories.
>
> So is there a way to tell rsync to ignore files with no extensions?

Yes, I think so. Try this:

+ *.pst
+ */
- *

(Use with --prune-empty-dirs, of course!)

-SM
--
--
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
Awesome.  I did not even consider trying "+ */".  

and like you said, using the --prune-empty-dirs option keeps it nice and clean.  very cool.

Thanks so much for the quick response.  I'm sure this will help someone else down the road.