有任何Cron工作替代? [英] Are There Any Cron Jobs Alternative?

查看:144
本文介绍了有任何Cron工作替代?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cron工作在我的服务器上关闭,服务器管理员不接受打开它。因为,cron作业减慢服务器等。所以,我需要一个替代。

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.

我必须运行一个php文件( cron.php )每2分钟。

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

那么,我该怎么做呢?

推荐答案

问题刚刚发布,我刚刚有同样的问题,但发现一个解决方案(基于 Kissaki的回答,谢谢! )

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.

前提条件:


  • SSH存取

  • Python

代码(python):

from subprocess import call
import time
while True:
    call(["php","cron.php"])
    time.sleep(120)

这篇关于有任何Cron工作替代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆