Next: General concepts
Up: Components / Programs to
Previous: llt
Contents
multitail.pl
multitail.pl reads one or multiple log files. The files read can be
written in anther log file and saved. This way, you can mix multiple
log files.
It's very robust, so it doesn't care if a file is deleted, moved or
newly created. You can also start it with a file name which does not
exist at that time.
multitail.pl [-a] [-d delay] [-p begin|end] [-t]
[-o outFile [-m max] [-P]
[[-n noFiles] | [-s [-c compressprog]] ]
] files...
All options are optional, you simply have to use one or more log file
names as parameter.
- --addName / -a
- Add the file name from which the line is
read to the output.
- --delay / -d
- Delay in seconds between checking each file
for new data. The value can by smaller than 1, eg. 0.2. The
default value is 5.
- --position / -p
- Read from the begin or end of the file;
allowed parameters are begin or end. Default is
begin.
- --withTime -t
- Add a time stamp to the output.
- --out / -o
- write output to a file, default is stdout
- --maxFilelen / -m
- Maximal size of a log
file. After reaching this size, the log file will be rotated (see
option noOfOldFiles) or compressed (see option saveLogs).
- --withPID / -P
- write pid of multitail.pl to the log
file; default is not to write it
- --maxlines / -l
- Maximum number of line to read in one
chunk from a log file. Default is 100. If you configure
``-delay 3'' then every three seconds multitail.pl will read
a maximum of 100 lines. The reason for this restriction is to avoid
that multitail.pl will consume too much power if a log file is
written too heavily.
- --noOfOldFiles / -n
- Number of old
rotated log files, default is 5.
With default values, it will look like this:
$ ls -l /tmp/storebackup.log*
-rw------- 1 hjc root 328815 30. Aug 12:12 /tmp/storebackup.log
-rw------- 1 root root 1000087 27. Aug 21:18 /tmp/storebackup.log.1
-rw------- 1 root root 1000038 20. Aug 19:02 /tmp/storebackup.log.2
-rw------- 1 root root 1000094 11. Aug 18:51 /tmp/storebackup.log.3
-rw------- 1 root root 1000147 11. Aug 18:49 /tmp/storebackup.log.4
-rw------- 1 root root 1000030 11. Aug 18:49 /tmp/storebackup.log.5
Older log files than *.5 have been deleted automatically.
- --saveLogs / -s
- Save the log files with a time and date stamp instead of deleting
them after rotating. (Setting this option overwrites the default
value of option noOfOldFiles.)
- --compressWith / -c
- Specifies the program to
compress the saved log files (eg. with gzip -9). Default
value is bzip2.
On the command line, the parameter to this option is parsed like a
line in the configuration file and normally has to be quoted on
the command line.
Next: General concepts
Up: Components / Programs to
Previous: llt
Contents
Heinz-Josef Claes
2012-02-12