logging output of a cronjob
Otavio Exel <[email protected]> Fri, 4 Apr 2008 16:27:39 -0300
| Newsgroups | gmane.comp.djb.syslog |
|---|---|
| Organization | Economatica Ltda |
| Message-ID | <[email protected]> |
Dear List, I have an every-minute cronjob that, once in a while, produces a lot of output; I'd like to save this output using multilog; I decided to do like that: $ crontab -l | grep xyz * * * * * setlock xyz/LOCK xyz/main $ cat xyz/main #! /bin/sh if <CERTAIN-CONDITION> then <DO-SOMETHING> | multilog /var/log/xyz fi $ _ I've never heard of someone using multilog this way; any pitfalls that I should be aware of? is there a recommended way to prevent 2+ instances of multilog from using the same dir? is there a way to force multilog to wait for /var/log/xyw/lock instead of exiting with code 111? someone suggested (many years ago) supervising a script like that... #!/bin/sh test -p my-pipe || mkfifo my-pipe exec cat my-pipe ...and sending to-be-logged-data to my-pipe; seems to me to be a good idea (although a bit too complex); any comments? []s, -- Otavio Exel /<\oo/>\ [email protected]