cron job helpz

Soldato
Joined
7 Jan 2007
Posts
10,607
Location
Sussex, UK
If I wanted to run one script every week on a Saturday at 19:30 and again on Monday at 21:00 (for every week of the year) what is the command to do that?
 
hhhmmm I was hoping I could combine them on one line.

I'm actually going to be setting this up on my web hosting using cpanel.

Potentially I'm going to have a 100 lines by the look of it. Is this bad?
 
i'm trying to learn php and what I'm thinking might be a way of doing it is to:

PHP:
$d=date("D");


if ($d=="Wed") {

                $dayofweek = date('D', strtotime('next saturday'));

                $day = date('d', strtotime('next saturday'));

                $month = date('m', strtotime('next saturday'));

                $year  = date('Y', strtotime('next saturday'));
                
                echo $dayofweek . $day . $month . $year;

} if ($d="Sat") {

$day = date('D', strtotime('next wednesday'));

$dayofweek = date('d', strtotime('next wednesday'));

$month = date('m', strtotime('next wednesday'));

$year  = date('Y', strtotime('next wednesday'));    
    
    
}

?>

Now I'm using cron to exec on say Weds at 19:30 the script will then notice it's weds and (when the script is built) insert the year, month, day and hour and mins into a new row in my mysql table for the correct if statement.

Does this seem logical?
 
Back
Top Bottom