[Gllug] rsync-ing sub-directories only

Richard Jones rich at annexia.org
Thu Nov 26 22:59:54 UTC 2009


On Wed, Nov 25, 2009 at 12:00:06AM +1300, David L Neil wrote:
> Richard Jones wrote:
> > On Mon, Nov 23, 2009 at 10:57:15AM +1300, GLLUG at getaroundtoit.co.uk wrote:
> > [...]
> > 
> > I think what you want is:
> > 
> >   cd ~/Desktop
> >   rsync -av --filter '+ /*/***' --filter '- *' . /path/to/target
> > 
> > Rich.
> 
> 
> Rich,
> (NB `pwd` must be Desktop)
> 
> rsync -rv --filter '+ /*/***' --filter '- *' . /junk
> 
> works perfectly, so I adapted it to cross my network and then used it 
> 'for real'...
> 
> Until I realised that I had used Firefox to File|SaveAs some web pages 
> directly onto the Desktop (not part of a "project", in fact CmdLN 
> HowTos!). These were then duly hoovered up by the rsync. Rats!

Working as documented then :-)

> So I set about finding another exclusion. This seemed a logical 
> extension of yours, but fails (regardless of case):
> rsync -rv --filter '+ /*/***' --filter '- *_FILES' --filter '- *' . ~/junk
> [code is all on one line, (my) email has word-wrapped]
> 
> So I tried extending by borrowing from my best effort (as below - no 
> tittering from the back row please!), but it worked a little too well, 
> and excludes any web pages saved within project file/sub-directories as 
> well as those sitting on the Desktop - so is equally inappropriate:
> rsync -rv --exclude='./*_files' --filter '+ /*/***' --filter '- *' . ~/junk
> 
> Any ideas please?

To be honest it took me a good half hour to arrive at the first set of
filters that worked, and after that I'm not sure I feel like
revisiting this.  Can you organize your files a bit more logically
instead :-?

> My fall-back position is either to borrow from Alain's suggestion and to 
> set up an "Unsorted" or "Personal" directory which could then be 
> excluded or `filter '-...'`-ed out[...]

I think this is an excellent idea ..

Rich.

-- 
Richard Jones
Red Hat
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list