Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

logrot.pl and logrot_trunc commands

None of my RME 3.5 boxes @ IDU 13 running on Solaris have the $NMSROOT/bin/logrot_trunc script.

Can I just:

cp /dev/null filename.log

to zero out the contents of a particular logfile?

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: logrot.pl and logrot_trunc commands

It would be helpful to know which files were not zeroed out. There have been a few logrot bugs fixed since the RME 3.5 version, but maybe others exist. The idea with logrot is that dmgtd should not need to be stopped for most log files. To know whether or not a manual truncation on the file will work, you will need to say which logfiles you need to rotate.

5 REPLIES
Cisco Employee

Re: logrot.pl and logrot_trunc commands

I guess I didn't add logrot_trunc until LMS 2.5. You can do "cat /dev/null > logfile" for most log files, but this won't work on, for example, daemons.log. For that, you will need to either use logrot.pl itself, or shutdown dmgtd, zero out the log, then restart dmgtd.

New Member

Re: logrot.pl and logrot_trunc commands

I ran logrot.pl -c and configured 5 or 6 of the logfiles.

I indicated I wanted to keep zero copies for of each;

I indicated I wanted the files to be kept at the default size they are now which was I think 30000;

That I wanted the extension to be .Z;

I then ran logrot.pl and only a couple were zero-ed out. I then did a dmgtd stop then ran logrot.pl and still the same results- only a couple of files where zero-ed out. I don't remember which ones they were....

This is why I'm asking if I can just:

cp /dev/null logfile.log or

cat /dev/null logfile.log-

What I could try doing is setting up logrot.pl with only a single log file at a time and see if that will work after stopping dmgtd.

Cisco Employee

Re: logrot.pl and logrot_trunc commands

It would be helpful to know which files were not zeroed out. There have been a few logrot bugs fixed since the RME 3.5 version, but maybe others exist. The idea with logrot is that dmgtd should not need to be stopped for most log files. To know whether or not a manual truncation on the file will work, you will need to say which logfiles you need to rotate.

New Member

Re: logrot.pl and logrot_trunc commands

I'll work on getting them to you next week. Unfortunately I don't have root access to the boxes so I have to work with my hands tied-

New Member

Re: logrot.pl and logrot_trunc commands

The Unix admin didn't want to take the time to configure logrot.pl w/ the -c option.

He just wanted to setup a script that read each of the log files from a text then copied /dev/null to each of them.

I'm sorry I was unable to get you a list of which files wouldn't zero out...

488
Views
10
Helpful
5
Replies