Are There Any Cron Jobs Alternative?

前端 未结 8 2057
礼貌的吻别
礼貌的吻别 2020-12-09 19:43

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 fi

相关标签:
8条回答
  • 2020-12-09 20:06

    Just an addition to the Answers. Rare case scenario.

    If your application is having frequent amount of database operations then you can maintain a separate table where the the one column will work as a measure when to run the script. Example as below

    Table CRON_RUN

    last_run
    ----------
    12-09-2018 11:55:12 (dd-mm-yyyy H:M:S)
    

    Now in your application a check can be performed every time when those frequent db operations occurs and check if the last_run date and the current date is having x difference . X is difference in time you want to run the script. 2 minutes in your case. Also if the difference is more then or equal to 2 minutes then the update statement will run to update the last_run column with the current date time and the next statement will be you cron.php script .

    0 讨论(0)
  • 2020-12-09 20:13

    There are several Cron alternatives for Linux. Like,

    1. Anacron - Anacron is a periodic command scheduler just like cron. The only difference is that it does not need your computer to be always running.

    2. fcron - Fcron is the best of both cron and anacron. It doesn’t require your computer to be running 24×7, and it can work with tasks on an hourly or minute basis.

    3. Hcron

    4. Jobber etc.

    For future reading refer to this article.

    0 讨论(0)
提交回复
热议问题