From: Mathias Koerber <mathias () staff ! singnet ! com ! sg>
To: tru64-unix-managers
Subject: SUMMARY: syslog.dated
Date: Thu, 26 Mar 1998 02:27:44 +0000 [thread overview]
Message-ID: <96078701111691.tru64-unix-managers.marc@archive.invalid> (raw)
I wrote:
| Hi Managers,
|
| I would like to write some cronjobs that write data to a file
| in the *current* syslog.dated subdirectory.
|
| Is there any way I can determine easily which one is the current one?
|
| (I know,
| ls -t /var/adm/syslog.dated | head -1
| should do the trick, but I'd like to avoid running that all the time)
|
| I was hoping that syslogd kept a symlink to the current directory somewhere,
| but I canot find anything.
|
| Does anyone have any hints...?
|
| This is for DU3.2 and DU4.0
1. One reply stated that it might be (actually the author said he hoped that
it would be) /var/adm/syslog, which it did not turn out to be on my
DU boxen :-(
2. Some suggested running a cronjob at midnight (and maybe also at reboot)
performing the links. However, this does not help if syslogd receives
any HUP signals (or gets restarted) at other times, as syslogd then creates
a new directory which would obviously not be linked...
So this is not a viable option if the directory must absolutely be the current
one...
This reply however made me think of the following:
If DU syslogd supported piping the message to a command, it might
be possible to construct a script, when called through
syslog itself:
in /etc/syslog.conf
syslog.debug /var/adm/syslog.dated/syslog.log
syslog.debug | /usr/local/bin/mysysloglinker
mysysloglinker:
#!/usr/local/bin/perl
while (<>) {
chomp;
/syslogd: restart/ && do {
$lastdir = `ls -t /var/log/syslog.dated | head -1`;
This way each time syslog started, it would execute the relinking script
However, DU (at least 3.2) syslogd does not provide this feature (piping
messages, so this option is out :-(
(Linux syslogd can do this, but they don't use syslog.dated anyway :-)
3. Other suggested just using the logger(1) command to write messages to the syslog.
While this will ensure that the messages end up in the correct directory,
however, this means that one will have touse one of the syslog facilities, and
cannot create arbitrary file...
I ended up using option 3 for the time being, but may go back to doing the
ls -t | head -1 trick for each job to get it right...
Thanks to all who replied.
Mathias
Mathias Koerber | Tel: +65 / 471 9820 | mathias@staff.singnet.com.sg
SingNet NOC | Fax: +65 / 475 3273 | mathias@koerber.org
Q'town Tel. Exch. | PGP: Keyid: 768/25E082BD, finger mathias@singnet.com.sg
2 Stirling Rd | 1A 8B FC D4 93 F1 9A FC BD 98 A3 1A 0E 73 01 65
S'pore 148943 | Disclaimer: I speak only for myself
* Eifersucht ist eine Leidenschaft, die mit Eifer sucht, was Leiden schafft *
next reply other threads:[~1998-03-26 2:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-03-26 2:27 Mathias Koerber [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-04-11 21:39 Summary: syslog.dated Glenda D. Monzon
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox