Somehow I am puzzled by
Background/Situation:
I have some cronjob that runs every two minutes and (sometimes) produces output. I do not want receive a mail every two minutes, but once daily. So I thought I will use
Crontab:
Inside
All those scripts do work, mail setup works as well, that is not the issue.
The thing I am puzzled:
The man page newsyslog.conf(5) states:
run shell command [...] after rotation
Any time
I tried to introduce some
Is the man page wrong? Should I increase the
What am I missing here?
Thanks for your help!
newsyslog
.Background/Situation:
I have some cronjob that runs every two minutes and (sometimes) produces output. I do not want receive a mail every two minutes, but once daily. So I thought I will use
newsyslog
for this job.Crontab:
Code:
*/2 * * * * /usr/home/user/code/verify.sh >> /var/log/verify.log 2>&1
/usr/local/etc/newsyslog.conf.d/verify.conf
:
Code:
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/var/log/verify.log 644 4 * @T00 BCXR /usr/home/user/code/verify_mailer.sh
Inside
verify_mailer.sh
I do some xzcat
onto /var/log/verify.log.0.xz
and pipe that (with more E-Mail stuff) into some sendmail -t
command.All those scripts do work, mail setup works as well, that is not the issue.
The thing I am puzzled:
The man page newsyslog.conf(5) states:
R
if this flag is set the newsyslog(8) will run shell command defined in path_to_pid_cmd_file after rotation instead of trying to send signal to a process id stored in the file.
run shell command [...] after rotation
Any time
verify_mailer.sh
is executed via newsyslog
it states that /var/log/verify.log.0.xz
does not exist.I tried to introduce some
sleep
, but the behaviour is the same.Is the man page wrong? Should I increase the
sleep
(currently 10 seconds, it's not much text, max. 1000 lines, that should be enough time). What am I missing here?
Thanks for your help!