Author Topic: How To Enable Cron?  (Read 4000 times)

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
How To Enable Cron?
« on: January 14, 2005, 07:20:17 pm »
I've installed the vixie cron package off the OZ 3.5.2 feeds, but it doens't seem to work. I know a bit about rc runtimes & /etc/init.d to see that it's not enabled there, so what do I have to do? Even if I run the cron daemon (/usr/sbin/cron) without errors, my crontab still isn't run. What time zone is cron in? My own (CST)  or UTC?

thanks in advance
« Last Edit: January 14, 2005, 07:24:06 pm by grog »
GROG!

CoreDump

  • Hero Member
  • *****
  • Posts: 713
    • View Profile
    • http://www.hentges.net
How To Enable Cron?
« Reply #1 on: January 15, 2005, 06:32:37 am »
Are you saying that cron ships w/o an init-script?
Sounds like a bug to me, I'll have a look later today.
Webmaster of hentges.net & Embedded Linux Developer.

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
How To Enable Cron?
« Reply #2 on: February 05, 2005, 12:21:49 pm »
Quote
Are you saying that cron ships w/o an init-script?
Sounds like a bug to me, I'll have a look later today.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=62695\"][{POST_SNAPBACK}][/a][/div]
just firgured I'd revisit this to see if you'd gotten around to fixing it. I removed the package & reinstalled, same. Any chance you could take some time to add those init scripts? thks
GROG!

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
How To Enable Cron?
« Reply #3 on: April 27, 2005, 01:06:01 pm »
So I dropped this for a bit but now I'm back . I re-installed cron under 3.5.3 & (I think) figured out the linux boot process. I manually created this script:

Code: [Select]
root@grond[/etc/init.d]# cat cron
#! /bin/sh

DESC=cron

case "$1" in
  start)
        echo -n "Starting $DESC: "
                cron
        echo "$NAME."
       ;;
  stop)
        echo -n "Stopping $DESC: "
                killall cron > /dev/null 2>&1
        echo "$NAME."
       ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
                killall cron > /dev/null 2>&1
        sleep 1
                cron
        echo "$NAME."
       ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
       ;;
esac
and created a symlink:

Code: [Select]
root@grond[/etc/rc2.d]# ll S20cron
lrwxrwxrwx    1 root     root           14 Apr 26 14:15 S20cron -> ../init.d/cron
Why S20? Cause it looked cool. No clue, so comments welcome. But now cron starts up all by itself & actually works. COOL!

!!!BUT!!!! (there's always at least one of those, right?) A reboot erases the crontab file (/var/cron/tabs). Does /var/ get cleaned out on reboot in OZ? What can I do to finally get cron working? thks
GROG!

JohnKiniston

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://
How To Enable Cron?
« Reply #4 on: April 27, 2005, 08:36:24 pm »
You could have a script that copies your crontab back to /var before cron starts and do your editing of your crontab in a different location.

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
How To Enable Cron?
« Reply #5 on: April 27, 2005, 10:41:10 pm »
Quote
You could have a script that copies your crontab back to /var before cron starts and do your editing of your crontab in a different location.[div align=\"right\"][a href=\"index.php?act=findpost&pid=77276\"][{POST_SNAPBACK}][/a][/div]
mmm. cool idea. I could replace the crontab command with a script that runs crontab.bin (the original), then after that exits then copy the tab file to the backup location, and have the init.d script restore that file to /var on startup. I'll post the stuff when I'm done.

I'd still like to know definitively the answer to the question about /var cleaning itself out. Doesn't anybody else here use cron (successfully)? thks
GROG!

hvontres

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • http://
How To Enable Cron?
« Reply #6 on: May 23, 2005, 01:03:14 pm »
Quote
Quote
You could have a script that copies your crontab back to /var before cron starts and do your editing of your crontab in a different location.[div align=\"right\"][a href=\"index.php?act=findpost&pid=77276\"][{POST_SNAPBACK}][/a][/div]
mmm. cool idea. I could replace the crontab command with a script that runs crontab.bin (the original), then after that exits then copy the tab file to the backup location, and have the init.d script restore that file to /var on startup. I'll post the stuff when I'm done.

I'd still like to know definitively the answer to the question about /var cleaning itself out. Doesn't anybody else here use cron (successfully)? thks
[div align=\"right\"][a href=\"index.php?act=findpost&pid=77290\"][{POST_SNAPBACK}][/a][/div]

I was able to get it to work by moving  my working /var/cron directory to /home/cron. I then added the following line to the end of /etc/init.d/populate-var.sh:
Code: [Select]
ln -s /home/cron /var/cron

I hope this helps.
[span style=\'font-size:10pt;line-height:100%\']Henry von Tresckow[/span]
--------------------------------------
SL-5600, OZ 3.5.4.2 (Hentges), Kernel 2.6.17 :)
1gb Kingston SD (ext2), 5Gb Seagate ST1 (3.03 Fw, fat32)
256 MB Kingston SD (ext2),256MB Viking CF,32MB CF (vfat),
homebuilt GPS unit (Based on RFMD RF 8000)

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
How To Enable Cron?
« Reply #7 on: June 01, 2005, 05:30:28 pm »
Quote
I was able to get it to work by moving  my working /var/cron directory to /home/cron. I then added the following line to the end of /etc/init.d/populate-var.sh:

Code: [Select]
ln -s /home/cron /var/cron [div align=\"right\"][a href=\"index.php?act=findpost&pid=81089\"][{POST_SNAPBACK}][/a][/div]
Works like a charm. Thanks muchly for the tip. a lot simpler than what I had planned :?

On a side note. Is there anyway to have a script that is running via cron to display opie-sh popups? I'm able to set the DISPLAY variable in my crontab & I know the script is picking that up, and I can see the ope-sh command being run in the /var/cron/log, but nothing on the screen.

thanks again
GROG!