[CentOS] Sort logfiles at rotation time
John Doe
jdmls at yahoo.comMon Nov 9 16:34:50 UTC 2009
- Previous message: [CentOS] Sort logfiles at rotation time
- Next message: [CentOS] Sort logfiles at rotation time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: Stephen Nelson-Smith <stephen at atalanta-systems.com> > I want to be certain that my apache and varnish logfiles are in strict > date order when rotated. I'd like to run a sort command against them > before they're compressed. > > I've had a look at the logrotate man page, and it looks like I can use > a postrotate/endscript to do this. However, I can see any reference > in the documentation for how to operate on the file. All the examples > seem to take the form of restarting something, or running some other > standalone script. What I want to do is run a sort command against > the newly rotated file - but how do I know what it is called? I am not sure you can retrieve and cycle through the filenames that were being rotated... I would create sections for each logfile to rotate (so you know the filename)... which might be tedious if you have many log files. A script to auto-generate the logrotate conf file in /etc/logrotate.d/ will help... JD
- Previous message: [CentOS] Sort logfiles at rotation time
- Next message: [CentOS] Sort logfiles at rotation time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list