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.
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:
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.
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.
That worked perfectly Joel, thanks! Any idea why it won't auto-start when the configured size threshold is reached? Thanks.
Logrot does not have an automatic trigger, which is why you need to schedule it to truncate the logs periodically at your convenience.
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?
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?
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
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.