0

I set up my CRM on-premise. Within CRM set up sync to Google Calendar. A manual test run within the CRM demonstrates that sync is working.

The CRM implementation guidelines state the following: For Unix/Linux systems, as a root user, edit the crontab file in /etc, and add an extra line at the end

The documentation provides a sample and explanation below:

*/5 * * * * <username> cd </srv/www/vhosts/1crm>; </usr/bin/php> scheduler.php

where <username> is the username that the web server runs as (usually defaults to 'apache' or ‘wwwrun’), and where </srv/www/vhosts/1crm> is the path to your 1CRM directory, and where </usr/bin/php> is the path to your php executable file.

I figure how to edit as root or enter crontab e -u root in Konsole of Kubuntu.

I modify the above as follows:

*/5 * * * * www-data cd /var/www/1crm; /usr/bin/php7.4 scheduler.php

And gained no result, so what am I missing? Did I get the user wrong or should it be just PHP, or is it picking up the right scheduler.php (presumably the one in the crm directory). How do I test a cron job, for that matter? Right now, I am going in the crm and checking if calendar new test calendar items got sync, from google calendar to the crm calendar.

steeldriver
  • 136,215
  • 21
  • 243
  • 336

1 Answers1

1

Don't use ;, use &&

cd /var/www/1crm && /usr/bin/php7.4 scheduler.php

You test cron jobs by adding logging.

Add >> /var/log/scheduler.log 2>&1 to the end and all prints and error notices will be added to scheduler.log.

Rinzwind
  • 299,756
  • Thank you everyone, collectively your answers helped me get it done. For example, need to edit the crontab in /etc. While the formatting answers helped as well. – mreardon May 11 '21 at 14:48