Normally, services are started during the boot process when the system
transitions into the appropriate run level.
I want to stop and start one of two of these services using cron, and
I'm just querying for a preferred method.
Let's say, for example, I am the only user of a system, and I want
fetchmail to start automatically in run levels 3 and 5 but only between
the hours of 0700 and 1700 during weekdays.
From my home account I can add a crontab entry:
0 7 * * * 1-5 sudo /sbin/rcfetchmail start
0 17 * * * 1-5 sudo /sbin/rcfetchmail stop
Or I can add it to /etc/crontab:
0 7 * * * 1-5 /sbin/rcfetchmail start
0 17 * * * 1-5 /sbin/rcfetchmail stop
A third way is to write a short script and put it into /etc/cron.hourly
--
Jerry Feldman