LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Log Rotation with Date & Timstamp for Rotated File (http://www.linuxquestions.org/questions/linux-general-1/log-rotation-with-date-and-timstamp-for-rotated-file-4175460274/)

Linux_CTL_2013 05-01-2013 07:05 AM

Log Rotation with Date & Timstamp for Rotated File
 


Hello ALL,

First thing am sorry if am Duplicating this thread with an existing thread.


I have set Log Rotation for my tomcat.out files to be rotated, please find the script set in logrotate.d folder.

/var/log/myapplication.out{
copytruncate
daily
rotate 20
nocompress
missingok
size 500M
}


The Script works fine, however when it rotates it makes filename.out.1 and so on. Is there a way i can change that Rotated filename to filename.date/timestamp?

Please Advice.

Thanks in Advance!

chrism01 05-01-2013 07:38 AM

See dateext, dateformat options http://linux.die.net/man/8/logrotate

Linux_CTL_2013 05-01-2013 09:53 AM

Quote:

Originally Posted by chrism01 (Post 4942561)
See dateext, dateformat options http://linux.die.net/man/8/logrotate

Hello Chris,


Thanks for the reply.


The man page i was referring to was a old kne, it didnt have the options.

Thanks again!

chrism01 05-02-2013 12:44 AM

Glad to help :)
Actually, the 'safest' (in terms of versions) is usually to use the man pages on your system; they should be correct for that(!) system, at least :)


All times are GMT -5. The time now is 01:47 AM.