Question
I am trying to set up
WebNotify to allow users to subscribe to topics and be notified by email. If I run the mailnotify script manually from the command line it succeeds and I get a change notification email:
perl -I bin tools/mailnotify [web]
however, when trying to run this as a cron job by adding the following to /etc/crontab:
*/5 * * * root cd /usr/local/twiki && perl -I bin tools/mailnotify -q [web]
I get a confirmation that cron has executed the command in syslog (every 5 min) but no emails get through. I tried redirecting output by appending '> logfile' and removing '-q' from the command. In that case, the last line in logfile is:
"Found change to [topic]"
what is absent is:
"Notified [email address] of changes in [topic]
1 change notification from [topic]"
I am guessing this might have something to do with the way cron executes the command but it is strange that it partially succeeds. (Note: I did try executing the command manually as root user and it worked as expected)
Any thoughts?
Environment
--
EdwardLevin - 24 Mar 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Without knowing more about your server environment, I can say that your crontab entry looks strange to me. You should be able to use simply:
*/5 * * * perl -I /usr/local/twiki/bin /usr/local/twiki/tools/mailnotify -q [web]
My crontab entry specifies the full path like that and email delivery works. Give it a try.
--
JohnWorsley - 26 Apr 2007
Closing this after more than 30 days inactivity; re-open if needed...
--
PeterThoeny - 02 Jun 2007