Tags:
create new tag
view all tags

SID-00059: Where to edit Crontab for MailerContrib

Status: Answered Answered TWiki version: 4.2.4 Perl version: 5.8.8
Category: CategoryEmail Server OS: Ubuntu 8.04 Last update: 16 years ago

Hi: I would email to be sent if a web changes. I have not edited crontab for fear that it is not proper. It exists as a text file in /etc/crontab. This seems like my system wide crontab. Is that the proper file to edit and place my command too run the perl script to get MailerContrib to work? If my TWiki's bin directory is installed at:/var/www/twiki/bin would the proper entry be: 0 0 * * * cd /var/www/twiki/bin && perl -I bin tools/mailnotify -q -Sandbox ? Thanks & apologies for a more Linux than TWiki question. Scott

-- ScottFreeman - 27 Jan 2009

Discussion and Answer

I have in /etc/cron.d a file named twiki whith this content and it works. I use ubuntu 8.04.

0,15,30,45 * * * * root cd /var/www/twiki/tools && perl -I /var/www/twiki/bin mailnotify -q -Sandbox

The example is for an interval of 15 minutes. You may want to change that to your desired interval.

-- EnriqueCadalso - 30 Jan 2009

Thank you!

-- ScottFreeman - 30 Jan 2009

See also cron docs at Wikipedia:Cron

-- PeterThoeny - 01 Feb 2009

Still stuck on getting MailNotify to work I created the file twiki in /ect/cron.d with the contents above without resulting mail.

I tried running mailnotify by entering the following:

scott@TWiki:/var/www/twiki/tools$ perl -I /var/www/twiki/bin mailnotify -q -Sandbox

Could not write "TWikiUserMapping has TURNED OFF EnableNewUserRegistration, because the password file is read only.

" to /var/www/twiki/data/warn200903.txt: Permission denied /var/www/twiki/data/.htpasswd open failed:

Permission denied at /var/www/twiki/lib/TWiki/Users/HtPasswdUser.pm line 118.

scott@TWiki:/var/www/twiki/tools$

Any help debuging would be appreciated. Thanks. Scott

-- ScottFreeman - 08 Mar 2009

Please do not edit /etc/cron.d directly. Use the proper way to edit crontab files, such as:

% crontab -u apache -e

Make sure to install the cron job for the user Apache is using, such as apache or nobody.

If you run it interactively, run it as the user Apache is using. Typically, that user cannot login (for security reasons). You can temporarily enable the shell for the Apache user in /etc/passwd if you want to test the mailnotification interactively.

-- PeterThoeny - 09 Mar 2009

For test purposes you can use scott@TWiki:/var/www/twiki/tools$ sudo perl -I /var/www/twiki/bin mailnotify -q -Sandbox. Google "sudo visudo" to add your user to the sudoers list if not yet included.

-- EnriqueCadalso - 09 Mar 2009

Ok My TWiki is installed at: /var/www/twiki

My mailnotify script is at: /var/www/twiki/tools/mailnotify

I believe my Apache user is www-data

If I enter the command: sudo crontab -u www-data -l The result is: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * root cd /var/www/twiki/tools && perl -I /var/www/twiki/bin mailnotify -q -Sandbox

Still no mail output. Should the user in my crontab file be www-data instead of root? Are my paths incorrect? Is there a log file I can check to see if errors are generated? Thanks for being patient. It wasn't clear how to use visudo or temporarily enable the shell for the Apache user to test interactively. Regards, Scott

-- ScottFreeman - 09 Mar 2009

try this:

% sudo crontab -u www-data -e
0,5,10,15,20,25,30,35,40,45,50,55 * * * * cd /var/www/twiki && perl -I bin tools/mailnotify 2>&1 >>/var/www/twiki/data/cron-mailnotify.txt

and watch /var/www/twiki/data/cron-mailnotify.txt

-- PeterThoeny - 10 Mar 2009

Try this to check that the mailer daemon is properly configured on the web server :

su - www-data -c 'echo "This is a test" | mailx -s "test" youraddress@yourdomain.com'

-- OlivierThompson - 13 Mar 2009

Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the TWiki consultants if you need timely help. We invite you to get involved with the community, it is more likely you get community support if you support the open source project!

-- PeterThoeny - 2009-04-17

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title Where to edit Crontab for MailerContrib
SupportCategory CategoryEmail
TWiki version 4.2.4
Server OS Ubuntu 8.04
Web server Apache2 2.2.8
Perl version 5.8.8
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2009-04-17 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.