10 More Discussions You Might Find Interesting
1. OS X (Apple)
In Mavericks, Apple has apparently moved control of log rotation to ASL. There's a 'ttl' value to determine how long log files will stick around for. I can compress them, change the way they're named, limit them by size, etc. But the one thing I cannot find is how to NOT keep one log file per... (0 Replies)
Discussion started by: jnojr
0 Replies
2. Shell Programming and Scripting
I have an application that rotate its log once it reaches 100mb and it keeps a total of 24 logs. I am trying to write a script to run daily to tar up the previous day logs files and move them to a different directory. here is a long listing of the logs in the directory:
-rw-r--r-- 1 user1 ... (6 Replies)
Discussion started by: e_mikey_2000
6 Replies
3. Solaris
Hi All!
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
7 Replies
4. Shell Programming and Scripting
Need some suggestion with an old problem form a thread here:
https://www.unix.com/shell-programming-scripting/153204-multiple-not-statement-awk.html
Since my log is large, I did get help to make a line that splits the log into two partstail -f syslog | awk '!/snmpd|ntpd|reject/{print | "tee... (1 Reply)
Discussion started by: Jotne
1 Replies
5. UNIX for Dummies Questions & Answers
Hi Guys,
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
1 Replies
6. Solaris
hi folk,
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
2 Replies
7. Solaris
HI,
What is log rotation in Solaris ? What are the essential steps to perform log rotation in Solaris? (1 Reply)
Discussion started by: Revathi@1
1 Replies
8. Solaris
Hi,
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
2 Replies
9. Shell Programming and Scripting
Hello all.
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
6 Replies
10. HP-UX
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
3 Replies
cronosplit(1m) cronosplit(1m)
NAME
cronosplit - split log files into cronolog-compatible files
SYNOPSIS
cronosplit --template=TEMPLATE [--print-invalid] [--help] [--version] file ...
DESCRIPTION
cronosplit is a simple program that reads lines from a set of input log files, which must be in Common Log Format or NCSA Combined/XLF/ELF
Format and write each lines to an output files, the name of which is constructed using the template specified and timestamp from the the
line. The template uses the same format specifiers as the Unix date(1) command (which are the same as the standard C strftime library
function).
Options
cronosplit accepts the following options and arguments:
--template=TEMPLATE
specifies the template for the output log files (using the format specifiers described below).
--print-invalid
print invalid log file entries to the standard error stream.
--utime
update modification time of output file according to last parsed log entry.
--verbose
print additional status messages to the standard error stream.
--debug
print debug messages to the standard error stream.
--help print a help message and then exit.
--version
print version information and exit.
Template format
Each character in the template represents a character in the expanded filename, except for date and time format specifiers, which are
replaced by their expansion. Format specifiers consist of a `%' followed by one of the following characters:
% a literal % character
n a new-line character
t a horizontal tab character
Time fields:
H hour (00..23)
I hour (01..12)
p the locale's AM or PM indicator
M minute (00..59)
S second (00..61, which allows for leap seconds)
X the locale's time representation (e.g.: "15:12:47")
Z time zone (e.g. GMT), or nothing if the time zone cannot be determined
Date fields:
a the locale's abbreviated weekday name (e.g.: Sun..Sat)
A the locale's full weekday name (e.g.: Sunday .. Saturday)
b the locale's abbreviated month name (e.g.: Jan .. Dec)
B the locale's full month name, (e.g.: January .. December)
c the locale's date and time (e.g.: "Sun Dec 15 14:12:47 GMT 1996")
d day of month (01 .. 31)
j day of year (001 .. 366)
m month (01 .. 12)
U week of the year with Sunday as first day of week (00..53, where week 1 is the week containing the first Sunday of the year)
W week of the year with Monday as first day of week (00..53, where week 1 is the week containing the first Monday of the year)
w day of week (0 .. 6, where 0 corresponds to Sunday)
x locale's date representation (e.g. today in Britain: "12/04/96")
y year without the century (00 .. 99)
Y year with the century (1970 .. 2038)
Other specifiers may be available depending on the C library's implementation of the strftime function.
SEE ALSO
apache(1m) cronolog(1m) date(1) strftime(3) environ(5)
More information and the latest version of cronolog and cronosplit can be obtained from
http://www.ford-mason.co.uk/resources/cronolog/
If you have any suggestions, bug reports, fixes, or enhancements, please mail them to the author.
More about Apache
Documentation for the Apache http server is available from
http://www.apache.org
AUTHOR
Andrew Ford <A.Ford@ford-mason.co.uk>
cronosplit is based on a script called splitlog by Roy Fielding, which is part of the wwwstat package.
March 1998 cronosplit(1m)