10 More Discussions You Might Find Interesting
I have a situation here ...
HACMP is configured with application monitoring script, which is generating messages .... which is running every minute ...
And every minute when monitoring script run, one one log file is generating .... and this log file is rotating ...
which is rotating... (1 Reply)
Discussion started by: linux.amrit
I seem to have a problem with log rotation, unless I am doing something wrong, I have type the following command for testing purposes to see if the -s option works but he did not:
logadm -w /var/adm/messages -C 8 -c -s 512k -t '/var/adm/messages.$n' -z 1
the file is now at this... (7 Replies)
Discussion started by: fretagi
3. UNIX for Dummies Questions & Answers
Good morning, I just want to know and collect ideas on this one. Regarding rotation of logs as I've observed it's not consistently functioning. I have a server with 8 Partitions, each partition has a dedicated directory for the logs that is needed and I set it every 5mins (300secs) the... (1 Reply)
Discussion started by: rymnd_12345
need advise regarding the log rotation, i have the logadm set at
30 2 * * * /usr/sbin/logadm
so it supposed to rotate once per day, but now it rotated twice!
but someone my log will rotate at 2:30 AM, but then another 2 hours later, it creates a new and rotate a new log again,... (2 Replies)
Discussion started by: dehetoxic
What is log rotation in Solaris ? What are the essential steps to perform log rotation in Solaris? (1 Reply)
Discussion started by: Revathi@1
Recently i received a request to rotate logs of catalina.out (tomcat). The file size was about 807 MB. I used logadm to truncate the log ( -c ) and zip (-z 0) it.
Everything worked fine, catalina.out.0.gz was created (22 MB) and the size of original catalina.out became 0kb.
After... (2 Replies)
Discussion started by: Mack1982
7. Shell Programming and Scripting
Hi, I current have many apps servers running and need to create a script to rotate logs daily, and then create an autosys job to delete logs that are older than 30 days. I was thrown into this and have no idea what to do, please help me get started, thanks!
and i will... (6 Replies)
Discussion started by: new2learn09
8. Shell Programming and Scripting
I have the below script to help with disk space cleanup that finds logs older than a specified number of days (say 10 days). I need it to grab "active" logs as well. Problem is an "active log" will not get archived unless I put in 0 days which I don't want to do, I need to leave the past 10 days,... (2 Replies)
Discussion started by: theninja
9. Shell Programming and Scripting
Due to some reason I can not use HUP to rotate needed log files.
So I use the standard method:
cp $file $file.1
cat /dev/null > $file
But if Java application in this time writing the output to $file,
in the beginning of it appears many "^@^@^@^@^@^@".
How to avoid it? Or how... (6 Replies)
Discussion started by: mirusnet
Can anyone post a sample log rotate and archive configuration on HP-UX?
I really don't know how to do that... :( (3 Replies)
Discussion started by: untamed
SAVELOG(8) System Manager's Manual SAVELOG(8)
savelog - save a log file
savelog [-m mode] [-u user] [-g group] [-t] [-p] [-c cycle] [-l] [-j] [-J] [-1 .. -9] [-C] [-d] [-l] [-r rolldir] [-n] [-q] [-D dateformat]
The savelog command saves and optionally compresses old copies of files. Older versions of file are named:
where <number> is the version number, 0 being the newest. Version numbers > 0 are compressed unless -l prevents it. Version number 0 is
not compressed because a process might still have file opened for I/O. Only cycle versions of the file are kept.
If the file does not exist and -t was given, it will be created.
For files that do exist and have lengths greater than zero, the following actions are performed:
1) Version numbered files are cycled. Version file.2 is moved to version file.3, version file.1 is moved to version file.2, and so on.
Finally version file.0 is moved to version file.1, and version file is deleted. Both compressed names and uncompressed names are
cycled, regardless of -l. Missing version files are ignored.
2) The new file.1 is compressed unless the -l flag was given. It is changed subject to the -m, -u, and -g flags.
3) The main file is moved to file.0.
4) If the -m, -u, -g, -t, or -p flags are given, then an empty file is created subject to the given flags. With the -p flag, the file
is created with the same owner, group, and permissions as before.
5) The new file.0 is changed subject to the -m, -u, and -g flags.
chmod the log files to mode, implies -t
chown log files to user, implies -t
chgrp log files to group, implies -t
Save cycle versions of the logfile (default: 7). The cycle count must be at least 2.
-t touch new logfile into existence
-l don't compress any log files (default: do compress)
-p preserve owner, group, and permissions of logfile
-j compress with bzip2 instead of gzip
-J compress with xz instead of gzip
For xz no strength option is set, and xz decides on the default based on the total amount of physical RAM. Note that xz can use a
very large amount of memory for the higher compression levels.
-1 .. -9
compression strength or memory usage (default: 9, except for xz)
-C force cleanup of cycled logfiles
-d use standard date for rolling
override date format, in the syntax understood by the date(1) command
-r use rolldir instead of . to roll files
-n do not rotate empty files
-q be quiet
If a process is still writing to file.0, and savelog moves it to file.1 and compresses it, data could be lost.
Debian 30 Dec 2017 SAVELOG(8)