cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1254
Views
0
Helpful
12
Replies

LMS 3.2 Logrot Malfunction

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.

1 Accepted Solution

Accepted Solutions

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.

View solution in original post

12 Replies 12

Joel Monge
Cisco Employee
Cisco Employee

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

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.

Ok, so what is the use of specifying the file size?

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.

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.

Thank you very much for your help Joel. You've been great and very patient :-)

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: