Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are There Any Cron Jobs Alternative?

Tags:

php

cron

jobs

Cron Jobs are closed on my server and server admin doesn't accept open it. Because , cron jobs slowing server etc. So, i need an alternative.

I have to run a php file (cron.php) every 2 minutes.

So, how can i do this ?

like image 553
Eray Avatar asked Jan 11 '11 20:01

Eray


People also ask

Is cron obsolete?

Timed Jobs Using cron Note: Although it is still supported, cron is not a recommended solution. It has been deprecated in favor of launchd .

Is airflow like a cron job?

With a few simple tasks in a DAG, Airflow is a beautiful cron alternative or even as a replacement for data pipelines otherwise managed by cron. It is time to start using this in everyday big data processing.

What does cron 0 * * * * * mean?

*/5 * * * * Execute a cron job every 5 minutes. 0 * * * * Execute a cron job every hour.


1 Answers

Even though the question was posted a while ago, I just had the same problem but found a solution (based on Kissaki's answer, thanks!) and thought I'd post it here for anyone still looking for a possible solution.

Prerequisites:

  • SSH access
  • Python

Code (python):

from subprocess import call
import time
while True:
    call(["php","cron.php"])
    time.sleep(120)
like image 83
KJdev Avatar answered Sep 28 '22 10:09

KJdev