08-17-2007 08:35 PM
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?
Solved! Go to Solution.
08-18-2007 07:36 AM
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.
08-17-2007 08:51 PM
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.
08-18-2007 02:01 AM
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.
08-18-2007 07:36 AM
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.
08-18-2007 09:09 AM
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-
08-20-2007 04:21 PM
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...
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