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
Hi,
On Mon, 2009-12-14 at 08:51 +0100, Michel van Deventer wrote:
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
And (of course) slows down bootup :) Better put the sleep 600 in your script and start the script detached from /etc/rc.d/rc.local (with an & )
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@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@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
On Mon, Dec 14, 2009 at 2:46 AM, Roland Roland R_O_L_A_N_D@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.
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@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