1

TL;DR: I need to run a command, but only thing I can do on my hosting is visiting URL. Is there way around it?

I am trying to set up Cron on my hosting and the manual tells me:

Set up cron to run this command:

php /path/to/mautic/app/console mautic:leadlists:update --env=prod

But problem is, that my hosting (possibly from security/marketing reasons) allows running only URLs as cronjobs.

So while I can set up running php script from url:

   0 0 23 1/1 * ? * http://example.com/cronjobs.php

I cannot run actual commands as given example above.

Is there a way of workaround?

Can I somehow write "usual" php script which will emulate running the first example?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Pavel Janicek
  • 14,128
  • 14
  • 53
  • 77
  • 1
    possible duplicate of [Using CRON jobs to visit url?](http://stackoverflow.com/questions/13259530/using-cron-jobs-to-visit-url) – raina77ow Aug 18 '15 at 18:26
  • Specifying only URL won't work, maybe try: `wget http://example.com/cronjobs.php` or `curl http://example.com/cronjobs.php` – kenorb Aug 18 '15 at 18:26
  • To make it clear: **I dont want to visit URL**. I need to run the first command, but from URL if it makes sense – Pavel Janicek Aug 18 '15 at 18:29
  • If you don't have root access and your host provider gave you limited access, you probably would want to contact them instead of asking how to do something you're not allowed to. I mean, you're not experiencing any technical issue. – Matheus Loureiro Aug 18 '15 at 18:40

1 Answers1

2

Here is a PHP script which allows you run Mautic commands via URL address. Description about how to use it is below the script.

https://gist.github.com/escopecz/9a1a0b10861941a457f4

John Linhart
  • 1,746
  • 19
  • 23