[EXIM] exicyclog suggestion (a minor issue)

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Wayne Folta
Dátum:  
Címzett: exim-users
Régi témák: [EXIM] URL for Exim 1.80
Tárgy: [EXIM] exicyclog suggestion (a minor issue)
I just noticed one side-effect of the way that exicyclog works. I wanted to
search back through all the saved mainlog's, and the last three are gzip'd,
so I did 'gunzip *.gz', which failed. All of the gzip'd files wanted to
uncompress to 'mainlog.2'. Probably not a big deal in the grand scheme of
things, but...

At least under Solaris, gzip saves the file name that was compressed. So if you

gzip x.gz
mv x.gz y.gz
gunzip y.gz

Gunzip sees the filename 'x' in the .gz file, so uncompresses to 'x', not
'y', which is different from other UNIX compression utilities. And this
leads to the problem mentioned above.

One way around this is to compress stdin, so no name is saved:

gzip < x > x.gz
mv x.gz y.gz
gunzip y.gz

results in the file 'y', which is what I'd like to see for mainlog's.

So it looks like you could change exicyclog's

$compress $mainlog.$keep

to

$compress < $mainlog.$keep > $mainlog.$keep.$suffix
$rm $mainlog.$keep

And things are close to what I want. You'd probably want to make the $rm
conditional on the $compress working, since most choices of $compress leave
the file intact if the compress fails. (How do you make it conditional in
shell?)

Does anyone else care about this? Is my suggested change workable and correct?

Wayne Folta
wayne@???



--
*** Exim information can be found at http://www.exim.org/ ***