Hi,

I want to setup the cronjob for the email settings. Atm only when I am online I get the notification about new tickets when someone send a email to support@. I used the the documentation for setup on my debian server, but it doesnt work. I tried

*/2 * * * * www-data /usr/bin/php /var/www/html/osticket/api/cron.php

and also with other users, but doesn't work. I get errors like "/bin/sh: 1: www-data: not found". Same when I use root.

So I also tried with API-key:

*/2 * * * * root wget -q -O /dev/null --user-agent=F021488EF108E00EAXXXXXXXXXXXXX https://support.example.com/api/cron.php

same problem. When I use the command in the shell I get no error but also don't reveive am e-mail.

What am I doing wrong??

  • RBGE replied to this.

    www-data should be the user that your webserver runs as. Or on some Linux distros it can simply be removed.

    I tried this too, see my first code... but also doesn't work.

    tarffm I get errors like "/bin/sh: 1: www-data: not found"

    I still maintain I have never seen any documentation for cron outside of osTicket where the user is specified at the beginning - this error means you're trying to run a command "www-data", which is why it's failing. (I know I could propose an edit to the wiki docs, but I don't have a GitHub account and am lazy 😇 )

    If you get rid of the cronjob you currently have, then type crontab -e -u www-data and enter the following:

    */2 * * * * /usr/bin/php /var/www/html/osticket/api/cron.php

    it should work. All the -u part in crontab does is tell it you're editing the crontab for the www-data user. You may have to put sudo in front of the crontab command!

    Write a Reply...