Subject: Re: crontab(1,5) entries
To: Nigel Reed <nigel@nelgin.nu>
From: Laine Stump <lainestump@rcn.com>
List: netbsd-help
Date: 02/17/2001 00:51:53
Nigel Reed <nigel@nelgin.nu> writes:

> If you start a process with cron which never exits - what happens when
> the time comes to start it again? You want two? three? four of these
> never ending processes?

If you put an entry in crontab with "@reboot" at the beginning of the
line, the job will be run once, and only once, when the machine
boots. It's quite handy.

> 
> If you want a program to start at boot time then you should consider
> putting it in /etc/rc.local.

You can't do that if you don't have root privileges on the machine in
question. In that case, adding an @reboot line in your personal
crontab works quite nicely. I do that for a few items that I want run
under my own uid, even though I do have root access on the machine. It
just makes more sense for things associated only with my uid to be in
a configuration file uniquely associated with me, rather than
cluttering up (or getting lost in) the system configuration files in /etc.

BTW, in answer to the original question - I have a few jobs I start
this way, and I don't have & at the end of any of them, eg:

   @reboot /usr/homes/laine/dorc5 >/dev/null 2>/dev/null

(dorc5 is a script that starts up the distributed.net client).