Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
or just echo "command to run etc" | at now + 2 minutes – symcbean Sep 6 '11 at 9:02

Your Answer


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.