How do you set up CRON?

Posted by user1723760 on Server Fault See other posts from Server Fault or by user1723760
Published on 2012-10-24T20:58:29Z Indexed on 2012/10/24 23:03 UTC
Read the original article Hit count: 230

Filed under:
|

I have never used CRON before but I want to use CRON in order to be able to perform schedule jobs for a php script. The php script is called "inactivesession.php" and in the php script is this code:

<?php

include('connect.php');


$createDate = mktime(0,0,0,10,25,date("Y"));
$selectedDate =  date('d-m-Y', ($createDate));

$sql = "UPDATE Session SET Active = ? WHERE DATE_FORMAT(SessionDate,'%Y-%m-%d' ) <= ?";                                         
$update = $mysqli->prepare($sql);
$update->bind_param("is", 0, $selectedDate);
$update->execute();

?>

Wht I want to do is that when the above date is reached (25th Oct), I want the php script to perform the UPDATE statement above. But my question is that how do I use CRON in order to do this?

The server I am using is the university's server known as helios, does CRON need to be set up in helios, (do I have to call the admin for this) or is it something else which uses CRON.

I have never used CRON before so can you explain to me how CRON can be set up for the example above with the server I am using?

Thanks

UPDATE:

Hi, I think the name of the OS is actually helios but I am not sure, I have a wikipedia page on this: here. I will read the crontab wikipedia page and see what I can find, but what my question is that is CRON already set up, do I just go right ahead and use CRON or do I need to set it up first?

© Server Fault or respective owner

Related posts about php

Related posts about cron