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

Re: logrotate: extension `date "+.%m-%d-%Y"`



Hi,

This works for me, when you have to rotate a lot of different logs, writing a simple script isnt as easy as getting logrotate to handle it all for you.

lastaction 
	DATE=`date +%F`; mv /var/log/messages.1.gz /var/log/messages-$DATE.gz 
endscript

this is of cource asuming that you are compressing the logs and the extension is left as default, ie when logrotate runs it will always create a *.1 file then compress it. *.1.gz

It may need a little tweeking to get it working for you.

Hope this helps



Reply to: