Re: logrotate naming of files by date

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2004-04-15 at 11:41 +0300, Marius Andreiana wrote:
> Is there possible to make logrotate name the files by date? We'd like to
> keep archives of logs named as yyyy-mm-dd.

You might be able to do this quite simply with a 'postrotate' script
(check 'man 8 logrotate'). You could do something along the lines of:

postrotate
	date=`date +%Y-%m-%d`
	mv /var/log/mylog.1.gz /var/log/mylog-$date.gz
endscript

Hth,
Matt
-- 
- -- --- ---- ------------------------------------ ---- --- -- -
Matthew Hall
http://people.ecsc.co.uk/~matt/
Sig: Pohl's law: Nothing is so good that somebody, somewhere, will not hate it.
- -- --- ---- ------------------------------------ ---- --- -- -

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux