[syslog-ng]Re:restarting syslog-ng
Gregor Binder
gbinder@sysfive.com
Thu, 8 Mar 2001 19:24:32 +0100
jmad on Thu, Mar 08, 2001 at 12:05:12PM -0600:
Hi,
> I'm currently using Caldera's Linux to host my syslog-ng. I currently use a
> cron script similar to below to stop, rotate my logs and restart the service
> (obviously not ideal, there's a brief moment where I lose messages). When I
> look at the man page for kill I do not see a -HUP switch. Does anyone know if
> this is just an undocumented option, or is it not available? If not, any ideas
In this case, -HUP is not really a switch, it's a short way of saying
'kill -s HUP ...', where HUP is the symbolic name of signal no.1, the
hangup signal.
On Linux, try kill -l to see what signals are available, or look at the
signal header file /usr/include/bits/signum.h
As for rotating logs, you might want to think about using log destina-
tions like this:
destination d_foo { file ("/var/log/foo.log.$YEAR$MONTH$DAY"); };
This will create files with date extensions. If you don't care about old
logs, you could have a cronjob like this:
0 0 * * * find /var/log -mtime +5 -exec rm {} \;
This will delete everything below /var/log that has not been modified in
5 days. Use 'find [...] -exec [...]' with extreme caution.
Greetings,
Gregor.
--
Gregor Binder <gregor.binder@sysfive.com> http://sysfive.com/~gbinder/
sysfive.com GmbH UNIX. Networking. Security. Applications.
PGP id: 0x20C6DA55 fp: 18AB 2DD0 F8FA D710 1EDC A97A B128 01C0 20C6 DA55