任务完成后,Cron Job不会丢失

时间:2015-04-24 19:33:45

标签: php cron-task

如何在任务完成后停止cron作业?

cron的工作转移一套没有。使用给定的特定限制,从1 sql表到另一个sql表的电子邮件ID。任务执行但不会停止。它重新运行以在表中添加重复值,但php文件中的限制设置不起作用。

我在这里发布了代码......

    <?php
    $con = mysql_connect("","","") or die(mysql_error());

    mysql_select_db("email_vijaya",$con) or die(mysql_error());

    session_start();
    ?>
    <?php  $ref = mysql_query("SELECT * FROM Email_Transford_Count WHERE status = '1'"); ?>

    <?php if(mysql_num_rows($ref) == '0')  { ?>

    <?php } else { ?>

    <?php while($yr = mysql_fetch_array($ref)) { ?>

    <?php $actual_Count = $yr['Actual_Count']; ?>

    <?php $Uploaded_ctual = $yr['Rest_Count']; ?>

    <?php $rest = ($actual_Count)*1-($Uploaded_ctual)*1; ?>

    <?php $re = $yr['Rest_Count']; ?>

    <?php  if($actual_Count >= $Uploaded_ctual) { ?>

    <?php $country = mysql_query("select Email_IDs from eData where City = '".$yr['city']."' AND category = '".$yr['category']."' limit $re"); ?>

    <div class="email_css">

    <?php while($u = mysql_fetch_assoc($country)) { ?>

    <?php mysql_query("UPDATE Email_Transford_Count SET Rest_Count = Rest_Count+1 WHERE User_id = '".$yr['User_id']."' AND category = '".$yr['category']."' AND status = '1' "); ?>
    <?php  if($actual_Count >= $Uploaded_ctual) { ?>
    <?php mysql_query("INSERT INTO eData_ClientTransfered VALUES ('','".$yr['User_id']."','".$u['Email_IDs']."','".$yr['category']."','1')"); ?>

    <?php } ?> 
    <?php } ?> 
    <?php  } else { ?>

    <?php mysql_query("UPDATE Email_Transford_Count SET status = '2'      WHERE User_id = '".$yr['User_id']."' AND status = '1'"); ?>


    <?php } ?>

    <?php } ?>

    <?php }  ?>

0 个答案:

没有答案