Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

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

Started by Aeryn 7 years ago · 5 replies · 1360 views
7 years ago

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
Comment
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.

And
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.

Thanks

7 years ago

I think your issue is quite common with cheap webhosting - most webhosters do not even provide a 'cron job' via form 😄 .
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 😃

👍 1
7 years ago

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
Aeryn

7 years ago

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.
HTH

👍 1
7 years ago

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.
Thanks

7 years ago

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

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 64 18 hours ago
Support · by Anna, 3 days ago
2 68 20 hours ago
Support · by Justin Young, 21 hours ago
1 35 21 hours ago
Support · by Duc , 1 week ago
2 71 6 days ago
Support · by Colin Hume, 1 week ago
2 63 6 days ago