Good information guys! I knew about less decompression and use that a lot. I should have been clearer that the zcat usage was so I could grep for something in a compressed (and normally large) syslog archive.
I like Rusty's explanation of logrotate because I have looked at it in the past and could never make heads or tails of how it worked. I knew the basics of why it existed but not any details. Maybe one of these days when I have nothing else to do I will look at it again :)
Larry
From: "Carruth, Rusty" <Rusty.Carruth@smartstoragesys.com>
[snip logrotate info]
> On a slightly different topic, I have found that some versions of 'less'This is actually found in *all* versions of less, at least since 1999, but the
> will automatically decompress compressed files to text. Or at least,
> one time I mistakenly said 'less /var/log/syslog*' when some of them
> were zipped, and LO! I didn't see any binary junk - it decompressed them
> for me. YMMV!
environment variable that controls this feature isn't always set. An older
Ubuntu didn't set it, f'rinstance. That's:
export LESSOPEN='|lesspipe.sh %s'
...so less, when invoked, checks that LESSOPEN var and pipes files through
/usr/bin/lesspipe.sh , which checks the filename for a metric ton of common
patterns and attempts to invoke appropriate decompressers for those patterns.
Like "bzip2 -dc" for files ending in .bz2 , "bzip2 -dc | tar tvvf -" for files
ending in .tar.bz2 , and so forth.
--
Matt G / Dances With Crows
The Crow202 Blog: http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss