Scheduler and cron jobs on a 1 and 1 hosted Grav site

Hi. I have successfully got my grav site working on MacOS localhost and got the scheduler working ok by copy/pasting the crontab code into terminal.

But when I uploaded the site to my hosting provider all is fine except the scheduler isn’t working. My host meets the minimum requirements for Grav.

So I checked with my provider 1 and 1 / Ionos and they have a form where I can create a cron job. The available fields are
Cron job name
URL to be called

And also I get to choose a time period for the cron job to run

So I guess my question is what do I put in the URL field? I’ve tried guessing a couple of things from the command line displayed in the admin panel but I just don’t really know what I’m doing.

Will this work ok on my hosting package? Will it run the back ups and cache purges ok? Or do I need access to the server?

I don’t have very much knowledge on development but I’m really wanting to get a good knowledge of Grav and learn all the nuts and bolts as best I can so I can have full control of my website. But this is a bit beyond me.


I think your issue is quite common with cheap webhosting - most webhosters do not even provide a ‘cron job’ via form :smile: .
nor shell access or real cron jobs.
so, your best choice will probably be to write a shell script with all commands you wish to be perfomed on a regular timed schedule.
of course, you cannot have different time tables this way.
but anyways: better than nothing.
just upload your script somewhere to your webspace, make it executable and fill the mentioned form with its name including the full path.
and, of course, welcome to GRAV :smiley:

1 Like

Thank you.

Unfortunately I don’t know how to write scripts as you describe, or what commands to put in them.

Is it important that the cache is cleared regularly?

Thank you

well, scripts are a wide range of possibilities - they can be written in any language that your hoster supports, e.g. php (without that, you would not be able to run grav…).
the most simple way, are bash shell scripts, just ask google for that.
in such a script, you can call any commands that are installed on your webspace.
for example, you can run bin/grav which is a php script that comes with grav and can do things like backups, clear cache and other.

1 Like

Right, ok thank you I appreciate your assist. I think I’ve found something that’s taught me some basics and I can try out.

A simple PHP script that run the grav scheduler thru shell_exec() or exec() function? Then the URL can call to this simple PHP script?

Haven’t work with 1&1 hosting, but most cPanel hosting has Cron function with a command line.

1 Like