cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1397
Views
10
Helpful
5
Replies

logrot.pl and logrot_trunc commands

getwithrob
Level 3
Level 3

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

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.

View solution in original post

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

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.

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.

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.

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-

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...