1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cron support in Tarifa??

Discussion in 'Tarifa Firmware' started by bhbattaglin, Feb 8, 2006.

  1. bhbattaglin

    bhbattaglin Network Guru Member

    Is cron supported by the Tarifa firmware?
    Should I be able to add lines to /tmp/crontab?
    Is the line format standard crontab (* * * * * command) to run "command" every minute every day?
    Should I be able to add "commands" to /tmp/cron.d?
    I have not yet been able to get it to work.
    Thanks.
     
  2. jchuit

    jchuit Network Guru Member

    Yes, it is also used by the firewall.

    /tmp/.... is the directory that is used and yes it should work.

    Greetings,
    jchuit
     
  3. bhbattaglin

    bhbattaglin Network Guru Member

    Can't get cron to work with Tarifa

    Don't know what is wrong then.
    I add the line:
    * * * * * root /tmp/testlog
    -OR-
    * * * * * /tmp/testlog

    to /tmp/crontab

    the file /tmp/testlog consists of:
    echo "Hello world" >> /tmp/logfile
    date >> /tmp/logfile

    nothing seems to happen.
    Is there some step I am missing?
     
  4. jchuit

    jchuit Network Guru Member

    Yesterday, I copied a script into rc_startup, in one of the routers:

    #!/bin/sh
    /bin/sleep 15
    echo PATH=/sbin:/bin:/usr/sbin:/usr/bin > /tmp/crontab
    echo "00 04 * * * root /sbin/reboot" >> /tmp/crontab

    This script does a resrtart every 24 hour, and this seems to work.

    Greetings,
    Jchuit
     
  5. bhbattaglin

    bhbattaglin Network Guru Member

    Thx 4 your response.
    Does this imply that /tmp/crontab MUST be written to once and only once at reboot time? (ie is crontab "read/loaded" shortly after the rc_startup script is run and then not again? This would explain why adding something to the /tmp/crontab file later does not work.

    If so, is it somehow possible to restart or reinitialize cron without doing a full reboot (and thereby clearing tmp)?

    Thanks,
     
  6. jchuit

    jchuit Network Guru Member

    Cron v3.0 Vixie

    I hope this will clear the problem a littlebit:

    The Rc_startup is executed as the last proces, shortly after the (re)start of the firewall.

    The cron used is CRON v3.0 from Paul Vixie. Each time the firewall is (re)started the crontab is overwritten, by the firewall initialisation.

    Greetings,
    Jchuit

    Edit: Soft restarting the router can be done by the rc command. rc restart does a restart of the services only.
     
  7. bhbattaglin

    bhbattaglin Network Guru Member

    cron fixed with simple restart

    The /tmp/crontab file is apparently read only when cron starts.
    If a change is made to the /tmp/crontab file, it is necessary to kill the cron process, then start it again by entering the cron command.
    This seems to work unless someone tells me about a problem.
    :thumb:

    while the format
    */2 * * * * root mycmd

    seems to work correctly (executing mycmd every 2 minutes)

    * * * * * root mycmd
    or
    */1 * * * * root mycmd

    Execute mycmd every second (or so) so watch out.
     

Share This Page