Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: backing up with zsh



Verily did Sven Guckes write:

> I am trying to use the zsh to back my webpages.
> I just want to backup text files, ie no pictures.

> They webpages all reside in "~/.P".  The pictures are within ~/.P/pics/ -
> excluding this one dir is not a problem, but the problem is that some of
> the pictures are scattered across the subdir of ~/.P still.
> How do I exclude these pictures?

> Possible filename extensions for pictures are:  bmp gif jpg jpeg
> But how do I specify these as case insensitive?
> Do I have to list all possible combinations of upper- and lowercase spelling?

possibly.

A good start would be:

cd ~/.P ; find . -type f \! \( -name '*.gif' -a -name '*.jpg' -a -name '*.jpeg' -a -name '*.bmp' \) -print | xargs cvvzf /tmp/guckes.web.980417.tar.gz

> Should I use zsh's globbing at all?
> Or should I exclude filename with gtar's "-X File" feature?

> 	gtar cvvzf /tmp/guckes.web.980417.tar.gz ~/.P -X files.exclude

> I may also need a restriction for file size (for all files), say 100K at
> most.

> Is that possible?

Sure, check the manpage for find(1), look for "-size".

-- Rob
----------------------------------------
Internet: windsor@xxxxxxxxxxx
Life: Rob@xxxxxxxxxxxxxxxxxxxxxxxxxx

The weather is here, wish you were beautiful.



Messages sorted by: Reverse Date, Date, Thread, Author