Make a quick vote 🗳 ️How do you refer to SuiteCRM extensions: add-ons or plug-ins? Click here to have your say 👈

Help with Schedulers

So I’ve tried making a custom scheduled task. Nothing fancy, just a small variation from the example given in the documentation.

After that, I got into the Schedulers module. Go to the bottom of the page to and see some instruction to run the Scheduler.

I entered this line:
" sudo crontab -e -u apache" in the terminal. Specifically inside /var/www/suite (this is where my suite instance is)

But, I get this error:
“no crontab for apache - using an empty one”
despite having the cron.php file…

Why is it giving me this error? I am relatively new to SuiteCRM so advice from veterans would be greatly appreciated!

Hi @Zetsubou5990
Maybe the problem is your terminal path-

Enter this line-: sudo crontab -e -u www-data and run the terminal cd /var/www/** **Comapny URL **; php -f cron.php > /dev/null 2>&1

Thank you for your reply but I only get this after I enter this line “sudo crontab -e -u apache(this is my user)”:

no crontab for apache - using an empty one

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
“/tmp/crontab.MjwFFA” 0L, 0C

I would also mention that I am entering that line inside /var/www/suite

cron.php file is a file belonging to SuiteCRM. It is meant to be launched by the system process called cron, and then it handles individual SuiteCRM schedulers.

To tell cron what it should do, namely, to ask it to run SuiteCRM’s cron.php, you have to add a line in cron’s configuration files. There is more than one of these. Typically you either use the system’s crontab, or a user-specific one, which is what the instruction tells you to do.

There’s no problem with the fact that it’s currently empty. Just go ahead and add the line there. Look for instructions on how to use your system’s editor (vi or nano) to do that.

Any crontab for “www-data” won’t work on your system, because on your system the correct user is the one given in the instruction: apache.

Thank you for your reply. Just two things if I may,

  1. Why would it say that it is empty despite having the cron.php file and opening it shows that it definitely isn’t empty.

  2. How do I insert this line: “* * * * * cd /var/www/suite; php -f cron.php > /dev/null 2>&1” ,
    when all I get after I enter this line “sudo crontab -e -u apache” is this:

no crontab for apache - using an empty one

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
“/tmp/crontab.MjwFFA” 0L, 0C

Should I be editing the file?

I feel like I already explained both those things…

  1. You’re telling the system’s cron for the first time, about the existence of something in SuiteCRM called cron.php. You’re asking the system thing to run the SuiteCRM thing.

  2. What you’re seeing is your system’s text editor. It’s probably vi because it’s ugly and really hard to use. I am not going into specifics about that here, try Googling, but the general idea is: either change your system’s text editor to something usable like nano, or get some online instructions on how to do your edit with vi.

1 Like

Thanks for the reply again.

Will try to do your suggestion on number 2.