Grav v2 and cron jobs

How to set up this cron task on my Kimsufi shared hosting.

(crontab -l; echo "* * * * * cd /home/monglup/www/blog;/usr/local/php8.3/bin/php bin/grav scheduler 1>> /dev/null 2>&1") | crontab -

Hello @BenLaKnet

In this type of hosting, scheduled‑task management is done through the OVHcloud client area.

Take a look at how Crear tareas automatizadas (CRON) en un alojamiento web.

Let us know, best regards.
Sergio Turpín

Heads up, the cron delay on OVH is 1 hour. That’s not ideal if you have a WordPress.... You can also use the free cronjob service with a more suitable range of frequencies.

Should I rewrite a shell or PHP script that does this?

the “cd” command then launching the “php” script?

But I don’t see how.

Hi @BenLaKnet

Yes, indeed, in the client area you cannot run the full command you used in the terminal directly. The interface is designed for you to specify the script (PHP or shell) you want to execute, not the full command with cd.

To get your cron job working, you need to create a script that does two things:

  1. Change to the correct directory (cd /home/monglup/www/blog).
  2. Run the PHP command (/usr/local/php8.3/bin/php bin/grav scheduler).

The simplest way is to create a script file in your hosting. You can do it like this:

  1. Connect to your hosting via FTP.
  2. Create a file, for example, cron_grav.sh in the root of your website (in www).
  3. Edit the file and paste the following content:
#!/bin/bash
cd /home/monglup/www/blog
/usr/local/php8.3/bin/php bin/grav scheduler
  1. Save the file and give it execution permissions (755)[1] from your FTP client.

Now go to the client area, to the CRON section of your hosting, and create a new task with these details:

  • Command to run -> The path to your script, which will be /home/monglup/www/cron_grav.sh
  • Language -> Choose SH (Shell)
  • Frequency -> The interface will let you set it in expert or simple mode.

Remember what @EricB19 mentioned: on OVHcloud shared hosting, the minimum execution frequency for cron jobs is once per hour.

Hope this helped,
Sergio Turpín


  1. The 755 permission gives the owner full access (read, write and execute), while the group and other users only get read and execute ↩︎

I had indeed thought of that idea, but I was hoping for a simpler one.

Thank you for your help.