Link to home
Start Free TrialLog in
Avatar of gsmith888
gsmith888

asked on

cron at reboot

Experts -

OS:Centos

I've seen someone on the net posted that when have an application start up automatically when the host starts. We can simply place an entry in cron with the following "@reboot /my/script/location.sh" ?

Is this a good practice or does this work only when the machine had received a signal to reboot? Meaning the command/solution will not work when the host machine was powered down then turned on as it is different from a reboot?


What is the proper way to do this?

Cheers!
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gsmith888
gsmith888

ASKER

arnold,

I've read the link you've provided and it has mention the directory/file is /etc/rc.d/rc.local

What would be the difference with the one you pasted  /etc/rc2.d/s99local ?
The S99local is part of chkconfig as a service script versus a single line directive that is run.
The chkconfig provides more control on when the commands are run based on run levels.
arnold,

I didn't understood those techy word smarty pants. :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial