Setup Cron Job in Oro Platform Application
Step 1: Add a cron for user nginx
Note I'm on Centos with Nginx web server. Open the crontab file in vi editor on behalf of the nginx user:
[kiat@reporting misoro]$ sudo -u nginx crontab -e
no crontab for nginx - using an empty one
crontab: installing new crontab
That will launch the vi editor.
Step 2: Editing the cron file in vi
Press Insert key.
Paste:
*/1 * * * * php /usr/share/nginx/html/misoro/bin/console oro:cron --env=prod > /dev/null
Notes:
- that will schedule execution of the oro:cron command every-minute,
- the root of the oro application is located in
/usr/share/nginx/html/misoro
.
Press Esc key.
Enter :wq to save and quite vi editor.
Step 3: Verify that it is registered:
[kiat@reporting misoro]$ sudo cat /var/spool/cron/nginx
*/1 * * * * php /usr/share/nginx/html/misoro/bin/console oro:cron --env=prod > /dev/null
Step 4: Restart cron service
[kiat@reporting misoro]$ sudo systemctl restart crond.service