Php 每15分钟按顺序排列20条Crontab消息

Php 每15分钟按顺序排列20条Crontab消息,php,crontab,Php,Crontab,我试着每15分钟发一次信息。我有20条消息,我希望每条消息间隔大约15分钟发送,即消息3在消息2后15分钟发送,消息4在消息3后15分钟发送。现在我只是想错开contab的工作,但有没有更高效/优雅的解决方案?谢谢你的帮助 14,29,44,59 10-21 * * * wget -q http://site/message2.php 13,28,43,58 10-21 * * * wget -q http://site/message3.php 12,27,43,57

我试着每15分钟发一次信息。我有20条消息,我希望每条消息间隔大约15分钟发送,即消息3在消息2后15分钟发送,消息4在消息3后15分钟发送。现在我只是想错开contab的工作,但有没有更高效/优雅的解决方案?谢谢你的帮助

    14,29,44,59 10-21 * * * wget -q http://site/message2.php
    13,28,43,58 10-21 * * * wget -q http://site/message3.php
    12,27,43,57 10-21 * * * wget -q http://site/message4.php
    11,26,42,56 10-21 * * * wget -q http://site/message5.php
    10,25,41,55 10-21 * * * wget -q http://site/message6.php
    9,24,40,55 10-21 * * * wget -q http://site/message7.php
    8,23,39,54 10-21 * * * wget -q http://site/message8.php
    7,22,38,53 10-21 * * * wget -q http://site/message9.php
    6,21,37,52 10-21 * * * wget -q http://site/message10.php
    5,20,36,51 10-21 * * * wget -q http://site/message11.php
    4,19,35,50 10-21 * * * wget -q http://site/message12.php
    3,18,34,49 10-21 * * * wget -q http://site/message13.php
    2,17,33,48 10-21 * * * wget -q http://site/message14.php
    1,16,33,47 10-21 * * * wget -q http://site/message15.php
    0,15,32,46 10-21 * * * wget -q http://site/message16.php
    14,31,45,59 10-21 * * * wget -q http://site/message17.php
    13,30,44,58 10-21 * * * wget -q http://site/message18.php
    12,28,43,57 10-21 * * * wget -q http://site/message19.php
    11,27,42,56 10-21 * * * wget -q http://site/message20.php
试试crontab: */15****wget-q

试试crontab:
*/15****wget-q

为什么不让一个crontab每15分钟运行一次,然后让它在服务器上触摸一个脚本,确定要发送20条消息中的哪一条。因为多个人在不同的时间收到消息(即,我可能在消息2上,但你在消息15上),因此,每条消息需要大约每15分钟发送一次,但如果这有意义的话,也需要与前一条消息间隔15分钟发送。但是,让脚本确定需要发送的消息要比让cron确定要发送的消息容易得多。你能用php做到这一点吗?您不需要给数据库中的每条消息或某些东西加上时间戳,然后检查是否经过了足够的时间吗?这会更有效吗?好吧,它可以像在数据库(甚至文本文件)中存储用户和最后一条消息号码一样简单。每次调用脚本时,获取每个用户的最后一个数字,增加该数字,发送新消息,并增加数据库中所有用户的数字。这当然不是完美的,但比拥有100个crontab要好。为什么不让一个crontab每15分钟运行一次,然后让它在服务器上触摸一个脚本,确定要发送20条消息中的哪一条。因为多个人在不同的时间收到消息(即,我可能在信息2上,但你在信息15上),因此每个消息需要大约每15分钟发送一次,但如果这有意义的话,也需要与前一条消息间隔15分钟发送。但是,让脚本确定在需要时发送哪些消息要比让cron知道更容易。你能用php做到这一点吗?你不需要在每个消息上加时间戳吗r数据库中的某个信息,然后检查是否经过了足够的时间?这样会更有效吗?好吧,它可以像将用户和最后一条消息编号存储在数据库(甚至文本文件)中一样简单。每次调用脚本时,获取每个用户的最后一个数字,增加该数字,发送新消息,并在数据库中为所有用户增加该数字。这当然不是完美的,但比拥有100个crontab要好。但这只会使每条消息每15分钟执行一次,可能会在ot之后发送每条消息她…这不是我想要的,但这会让每15分钟执行一次消息,可能会一条接一条地发送每一条消息…这不是我想要的