
Hi Maxim, Welcome in the exciting world of unix administration ;-) a. The cronjob should run under user www-data. Then there is no need to 'su' b. perhaps it is because of e-mail, but it appears the script is on a new line. In a 'crontab' you can _never_ use a new line (unless you escape/end it with a "\") For (a): Either "sudo su - www-data" and then "crontab -e" to edit, Or "sudo crontab -e -u ww-data" (edit as 'root' the user's crontab). For (b): once editing, I suggest you fill it with all, or part of the attached file. The crucial part is: # fetch emails every 10 minutes */10 * * * * $HOME/bin/PostMasterMailbox.pl >> /dev/null $HOME suggests it is ranfrom 'otrs' user, so may need to be replaced with the full path, in your case: # fetch emails every 10 minutes */10 * * * * /usr/share/otrs/bin/PostMasterMailbox.pl >> /dev/null Send us the output of sudo crontab -l -u www-data to verify :-) gr, Frans P.S. /usr/share/otrs/var/cron hold the examples. P.P.S. more tips on croin&ubuntu: http://ubuntuforums.org/showthread.php?t=102626&highlight=cron
-----Original Message----- From: otrs-bounces@otrs.org [mailto:otrs-bounces@otrs.org] On Behalf Of maximx86 Sent: vrijdag 1 mei 2009 15:40 To: User questions and discussions about OTRS. Subject: Re: [otrs] error executing PostMasterMailbox.pl
Hi Michiel,
I am sorry I have to bore you again I am having problems with installing the conrjob for PostMasterMailbox.pl. I tried to get some help on different forums to no avail.
So the command I run manually is:
sudo su - www-data cd /usr/share/otrs/bin ./PostMasterMailbox.pl
this works
the cronjob I tried */10 * * * * sudo su - www-data /usr/share/otrs/bin/PostMasterMailbox.pl >> /dev/null
I am being asked for the password and then I get
/usr/share/otrs/bin/PostMasterMailbox.pl: 23: use: not found /usr/share/otrs/bin/PostMasterMailbox.pl: 24: use: not found /usr/share/otrs/bin/PostMasterMailbox.pl: 27: use: not found /usr/share/otrs/bin/PostMasterMailbox.pl: 28: Syntax error: "(" unexpected Press ENTER to continue and close this window.
I was told to try */1 * * * * www-data /usr/share/otrs/bin/PostMasterMailbox.pl >> /dev/null
still no luck
help please! :)
thank you
So OK, here's the catch..
I found out that the otrs2 package on Debian/Ubuntu uses the www-data user for this. If you'd like to run PostMasterMailbox.pl by hand you'd use 'sudo su
On Wed, Apr 29, 2009 at 3:36 PM, Michiel Beijen
wrote: - www-data'
The cronjobs for OTRS are NOT installed after using the otrs2 package; please refer to: