Cron What?

Well, I didn't think that I was thick until I started trying to use the HAH livebox. But having struggled my way to getting a system running trying to use Google calendar to schedule appliance switching with pretty limited success, I was looking forward to a simple scheduling system, which was what cron/tab appeared to be.

Member for

16 years 5 months

BoxingOrange

14 years 11 months ago

Have you upgraded to 297 yet?  Assuming you are, you will need to enable the cron service through the web interface, it's under the Admin->Services tab.  After that login as root and issue crontab -e to start editing the root crontab file, this uses the unix vi editor.  

Hope this helps, I'm online most of tonight if you want to work it through until you get it going.

Member for

16 years 10 months

brett

14 years 11 months ago

The command "crontab -e" is used to open the editor VI to edit your crontab.  It is in the editor you enter a crontab line.

This command will list the crontab

# crontab -l
0 7 * * 1-5 ether-wake -i br0 3c:d9:2b:5b:67:c2
#

As the only user on the system is root the file created will /etc/crontabs/root which will be effectively the output for crontab -l

I'm sort of assuming people are mildly familar with unix based concepts.

Brett

Member for

15 years 1 month

allanayr

14 years 11 months ago

Thanks for the clarification. The crucial point that I missed was that issuing the command "crontab -e" would not only edit but actually CREATE the required file.

The very first line in the wiki says "crond scans the file CRONTAB every minute and checks every line" which set me off on completely the wrong track. In fact the file which it scans is /etc/crontabs/root. Had that been obvious to me it is likely that the files which I had created would have worked.

Astonishing how a piece missing from a jigsaw makes the picture completely wrong :-(

 

P.S. Hope this saves someone else the trouble that I had.

Member for

16 years 10 months

brett

14 years 11 months ago

crond scans ALL the files in the directory /var/spool/cron/crontabs/

As /var resides on a memory based filesystem that is created on startup by the /etc/rc.d/rc.sysinit script you will find that /var/spool/cron/crontabs is a linkage to /etc/crontabs so that your configurations persist across reboots.

# cd /var/spool/cron/
# ls -l
lrwxrwxrwx    1 root     root           13 Dec 31  1969 crontabs -> /etc/crontabs
#

Each user of the HAH will have a file named after their username.  The HAH only has 1 user "root" so the only file you will see will be /var/spool/cron/crontabs/root or /etc/crontabs/root (where it really lives)

A little more wierdness for your amusement.

Brett