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

Crontab

Discussion in 'HyperWRT Firmware' started by Judex, Oct 7, 2004.

  1. Judex

    Judex Network Guru Member

    Greetings!

    Does soemone have a clue, why cron would execute following line again and again?
    :roll:
    I added
    3 */6 * * * root /var/bin/usage.sh > /dev/null 2>&1
    with echo to /tmp/crontab.
    The script was started by cron at 6:02:04pm first and then over and over till 6:03:02.
    usage.sh contains:

    #!/bin/sh
    echo `uptime` - `date +'%Y%m%d%H%M'` - `cat /proc/net/dev | grep vlan1` > /var/www/usage

    The results are ok and then copied to another host, where they get parsed and logged.
    When one puts * * * * * to crontab, the followed command gets started always by cron and not only once a minute.

    Any hints?

    Regards, Judex

    Besides: Playing around with batbox is great!
     
  2. SFCRAIG

    SFCRAIG Network Guru Member

    curious, what if we added an entry to crontab to have it kick off the syslogd daemon once an hour. if it was already present, would it cause a problem having multiple processes? And I'm assuming that there is a kill command for process, if you came home from work and found 6 active ones, couldn't you just kill them then?

    I'm wondering if this is a messy but possible workaround for the syslog problem in busybox with wallwatcher using cron.
     
  3. Judex

    Judex Network Guru Member

    The logging to Wallwatcher is not a syslog but a klogd problem. Klogd dies after some hours. Syslogd seems to be stable as I cat /proc/kmsg via logger to it since three days now and everything works.

    Anyway, the cron problem does not show up, if you do not use a "/" in time definitions. Using "0 0,6,12,18 * * *" works, but "0 */6 * * *" starts the process again and again for about a minute.
    The started processes all run correct and terminate as they should afterwards. So there is no need to kill them for me. If you start daemons they would be run multiple probably and you have to kill them.

    Regards, Judex
     

Share This Page