Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to have a simple shell script that will be executed 2 min after my server came up after reboot.

I just want to have a service restarted. can anyone advice? Thanks.

share|improve this question
    
Why not just fix the problem that requires the service to be restarted in the first place? –  Ignacio Vazquez-Abrams Sep 6 '11 at 7:47
add comment

1 Answer

up vote 5 down vote accepted

Create an at job on system boot, either from a new init script or from /etc/rc.local.

echo "command to run etc" | at `date --date='2 minutes' +%H:%M`
share|improve this answer
2  
or just echo "command to run etc" | at now + 2 minutes –  symcbean Sep 6 '11 at 9:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.