Cronjobs and Loops

Discussion in 'General' started by vaio1, Oct 20, 2007.

  1. vaio1

    vaio1 Member

    Hi guys,

    how can I set a cronjob on the Fedora 7?

    I have written the following command in the /etc/crontab file:

    Code:
    
    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=root
    HOME=/
    
    
    # php cronjobs
    
    #It starts all saturday at 06:00
    #* 6 * * 6 lynx -dump http://www.example.com/action.php
    
    # The Job starts every day at 05:00.
    #* 5 * * * lynx -dump http://www.example.com/action1.php
    
    # The Job starts every saturday at 04:00
    #* 4 * * 6 lynx -dump http://www.example.com/action2.php
    
    # The Job start every saturday at 24:00.
    #* 0 * * 6 lynx -dump http://www.example.com/action3.php
    
    # The Job starts at 23:00 of each Saturday
    #* 23 * * 6 lynx -dump http://www.example.com/action4.php
    
    # run-parts
    01 * * * * root run-parts /etc/cron.hourly
    02 4 * * * root run-parts /etc/cron.daily
    22 4 * * 0 root run-parts /etc/cron.weekly
    42 4 1 * * root run-parts /etc/cron.monthly
    ~
    ~
    
    but the operations have been repeated many times.
    which is the mistake?

    Was I likely wrong with the time settings and the actions are repeated many times?

    Thanks
     
    Last edited: Oct 20, 2007
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do not edit /etc/crontab file manually.

    Instead, run the command:

    crontab -e

    and insert the line for your cronjob.
     
  3. vaio1

    vaio1 Member

    The problem is the loop.
    Maybe there is an error here:
    * 6 * * 6 lynx -dump http://www.example.com/action.php

    the first asterix are the minutes. To execute it only one time, have I to set this parameter to zero?

    thanks
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please tell me in words, when exactly and how often shall the cronjob beeing executed?
     
  5. vaio1

    vaio1 Member

    I would like to start a php page at the saturday morning at the 6am o' clock
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Try this:
    Code:
    0 6 * * 6 lynx -dump http://www.example.com/action.php
     

Share This Page