[CentOS] Cron job? or something else? help..

Mon Dec 14 17:43:59 UTC 2009
Ray Van Dolson <rayvd at bludgeon.org>

On Mon, Dec 14, 2009 at 12:39:50PM -0500, Brian Mathis wrote:
> On Mon, Dec 14, 2009 at 2:46 AM, Roland Roland <R_O_L_A_N_D at hotmail.com> wrote:
> > Hello,
> >
> > i have a certain issue at hand that i'm trying to solve.
> >
> > there's a certain command that i need to execute 10 minutes after boot.
> > how can i set that? im not very expert with cron jobs but can it be done
> > that way? i know that cronjob works on specified time but how can i set
> > it to run with '10 min after startup" as a condition ?
> 
> Only you know your specific requirements, but this seems like an odd
> thing to need.  Do you need to wait 10 minutes to make sure some
> service is running before starting something else?  What creates the
> need for a 10 minute delay?  Maybe there's a better way to handle it.

You could configure a service that starts automatically in run level 3
(or 5) whose start() argument forks off (backgrounds) the process you
want to run, prepended by a "sleep 600" statement.

This way the service won't hold up everything else, but your command
won't run until 600 seconds have elapsed.

You could write the sysv init script to have service <servicename> stop
abort, etc...

Ray