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 ?
Hi, On Mon, 2009-12-14 at 09:46 +0200, Roland Roland 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 ?There's no such option in cron. But the easiest way to do this is to put it in /etc/rc.d/rc.local like this : sleep 600 && <command> this waits 600 seconds and (if succesfully) executes your command Regards, Michel
Roland Roland 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 ? >put a script in rc.local thats run with a 'detach', eg, a trailing &, and in this script, have something like... sleep 10m /path/to/rest-of-your-commands
Quoting Roland Roland <R_O_L_A_N_D at hotmail.com>:> 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 ? > > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >maybe cron "time" @reboot helps with combined to at now + time command ? -- Eero -- Eero
Roland Roland 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 ? > >In /etc/rc.d/rc.local add a line like this: /usr/bin/at 'now + 10 min' -f /path/to/command -- Benjamin Franz
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.