06-08-2010 10:31 AM
Hi, I have logrot configured to rotate syslog.log every 256MB, but it does not automatically do so. I have to manually run the script. Perhaps I'm missing something obvious. Please advise. Thanks.
Solved! Go to Solution.
06-09-2010 01:36 PM
Understood, unfortunately that's not the way it is designed to work. It is not monitoring the log files constantly to automatically truncate. However, by scheduling several times a day, you can achieve a similar effect.
06-08-2010 11:15 AM
Have you actually created a shedule to run the script under CS > Server > Admin > Log Rotation at a certain point in time? You can confirm if there are scheduled jobs by running the below command in DOS:
%SYSTEMROOT%/system32/at.exe
06-08-2010 12:04 PM
Hi Joel, thanks for the response. I have it scheduled to run daily which works, however, I need it to run much more frequently as the log file is incrementing quickly.
06-08-2010 12:20 PM
This is not possible via the GUI, but you can configure the logrot.pl to run several times a day via CLI like this:
AT 01:00 /every:M,T,W,Th,F,S,Su C:\Progra~1\CSCOpx\bin\perl.exe C:\Progra~1\CSCOpx\bin\logrot.pl
AT 03:00 /every:M,T,W,Th,F,S,Su C:\Progra~1\CSCOpx\bin\perl.exe C:\Progra~1\CSCOpx\bin\logrot.pl
AT 05:00 /every:M,T,W,Th,F,S,Su C:\Progra~1\CSCOpx\bin\perl.exe C:\Progra~1\CSCOpx\bin\logrot.pl
This would be assuming your installation path is C:\Program Files\CSCOpx. If successful, you will see a new job ID created after each new schedule.
06-09-2010 07:11 AM
That worked perfectly Joel, thanks! Any idea why it won't auto-start when the configured size threshold is reached? Thanks.
06-09-2010 08:56 AM
Logrot does not have an automatic trigger, which is why you need to schedule it to truncate the logs periodically at your convenience.
06-09-2010 11:52 AM
Ok, so what is the use of specifying the file size?
06-09-2010 12:36 PM
If you don't specify a size on which the script is supposed to rotate a log, then how will it know at what size you want it to rotate the log?
06-09-2010 01:01 PM
I think my wires are crossed on this one. I have been trying to get logrot to actually archive/backup at the size I specify here, but it doesn't. Are you saying that it should, in fact, be doing so?
06-09-2010 01:15 PM
What exactly are you trying to accomplish? Can you provide a detailed example?
For example, if you set syslog.log to be rotated at 256MB, once the logrot.pl script is run, it will check if the syslog.log is 256MB or higher. If so, it will rotate it. Otherwise, the file will not be rotated. If logrot.pl is not ran manually or scheduled to run, it will also not rotate the file.
To have some details of what logrot is doing, you can run in verbose mode:
C:\PROGRA~1\CSCOpx\bin\perl.exe C:\PROGRA~1\CSCOpx\bin\logrot.pl -v
06-09-2010 01:26 PM
Ah got it. You answered my question. I would really like logrot to run when the syslog.log file reaches size 'x' regardless of scheduling.
06-09-2010 01:36 PM
Understood, unfortunately that's not the way it is designed to work. It is not monitoring the log files constantly to automatically truncate. However, by scheduling several times a day, you can achieve a similar effect.
06-09-2010 01:44 PM
Thank you very much for your help Joel. You've been great and very patient :-)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide