schedule a script at "system startup"

Werther Pirani werther.pirani at nexgo.de
Sun Dec 4 06:14:45 PST 2005


Ian Lord wrote:

> I guess there might be a way to put a script in /etc/rd.d/ but I
> don't know how to run it under a specifid uid

Create a script (name is not important as long as it ends in .sh)
and put it in /usr/local/etc/rc.d. Also, make sure the script is
executable and contains lines like:

#!/bin/sh

echo -n " some informative message here"

su -l username -c '( command arg1 ... argn )'

Run the script (as root) manually with /usr/local/etc/rc.d/sctript.sh to
verify everything is okay and in case you need/want to add redirection
(still inside parenthesis).



Hope this helps,

Werther
-- 
I went mad for a while -- did me no end of good.


More information about the freebsd-questions mailing list