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

On Thu, May 10, 2012 at 9:01 AM, Matt Graham <danceswithcrows@usa.net> wrote:
From: "Carruth, Rusty" <Rusty.Carruth@smartstoragesys.com>
[snip logrotate info]
> On a slightly different topic, I have found that some versions of 'less'
> 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!

This is actually found in *all* versions of less, at least since 1999, but the
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



--
Dazed_75 a.k.a. Larry

Please protect my address like I protect yours. When sending messages to multiple recipients, always use the BCC: (Blind carbon copy) and not To: or CC:. Remove all addresses from the message body before sending a Forwarded message. This can prevent spy programs capturing addresses from the recipient list and message body.