Results 1 to 7 of 7
  1.    #1  
    Can anyone help??

    I'm trying to set up a cron job to run hourly to run the script referenced in this thread...

    http://forums.precentral.net/general...t-come-up.html

    I'm not sure how to set up a cron job nor am I sure if i need a crontab or Crond. I read somewhere out here that webOS clears the crontabs every time it boots. Is this true? I also use PresetReset to reboot my Pre nightly.

    Any help would be appreciated.
  2. #2  
    Go to Webos internals site:

    Crond - WebOS Internals

    And yes I had the issue which webOS clearing my crontab so I created another job which populated the crontab after the modified cron job ran. Check out the wiki you'll understand what I mean.
  3.    #3  
    Ok, so I added the following...

    /etc/event.d/FreeMemory

    start on stopped finish
    stop on runlevel [!2]
    console none

    respawn

    sh /var/home/root/FreeMemory.sh


    And /var/home/root/FreeMemory.sh

    #!/bin/sh

    sync
    #sh -c "echo 1 > /proc/sys/vm/drop_caches"
    #sh -c "echo 2 > /proc/sys/vm/drop_caches"
    sh -c "echo 3 > /proc/sys/vm/drop_caches"

    sleep 3600
    #3600 should = 1 hour. 600=10 min


    When I look in Upstart Manager, it shows that crond is running. So should I assume it worked? How would I know, other than theoretically, better performance if the script functions correctly.
  4.    #4  
    bump!

    Anyone?
  5. #5  
    I have 3 files in my setup I use to automagically backup my pre using rsync:

    mod-crond
    myjob
    cron.txt

    mod-crond and myjob are located in /etc/event.d/

    Here are their contents:

    mod-crond

    # -*- mode: conf; -*-

    # jobfile for busybox crond, with pre-start commands to create the
    # directory and files it wants by default. That there's not 'start
    # on' stanza is intentional: it's for development use only. We can
    # turn it on later if we need it, e.g. to keep the clock synced. It
    # does work.

    start on stopped finish
    stop on runlevel [!2]

    respawn

    exec /usr/sbin/crond -f -L /var/log/crond

    pre-start script
    mkdir -p /var/spool/cron/crontabs
    ln -sf /etc/cron/crontabs/root /var/spool/cron/crontabs/root
    end script


    myjob

    start on started mod-crond

    script
    cp /var/home/root/cron.txt /var/spool/cron/crontabs/root
    chmod 600 /var/spool/cron/crontabs/root
    end script


    cron.txt

    00 03 * * * /var/home/root/setupbackup.sh
    05 03 * * * /var/home/root/stoprsync.sh


    I'm doing this because on reboot I need to reinitialize crond.
    the two script file output is redirected to log files so I know they execute.

    I think you should just initialize crond in event.d and then setup crontab to execute your scripts at a time you designate instead of using sleep.

    You can check to see if crontab has entries by typing crtontab -l
    You can edit it using crontab -e

    I hope this helps.
    Mayo
  6. dz2k's Avatar
    Posts
    7 Posts
    #6  
    i cant get this working automatically after a reboot of the phone on 1.4.5. i did have it working automatically before the reboot though. If the phone does have to be rebooted at some point, run crond stop, crond start via terminal and it'll automatically run the script at interval again. As a last resort, one can always run the script manually.
    Last edited by dz2k; 03/14/2012 at 01:36 PM.
  7. #7  
    Quote Originally Posted by dz2k View Post
    i cant get this working automatically after a reboot of the phone on 1.4.5. i did have it working automatically before the reboot though. If the phone does have to be rebooted at some point, run crond stop, crond start via terminal and it'll automatically run the script at interval again. As a last resort, one can always run the script manually.
    I'm noticing the same issue. Why is cron not starting automatically at boot?

    It was working for me before, but it seems to have just stopped working. ican manually restart it but that defeats the purpose of cron.

Posting Permissions