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'd like to run a script at 6pm on a remote server but don't want to wait around to trigger it. I don't want to use cron since it's a one time deal.

Can I do something like "nohup myscript &" with a "sleep" or "after" command?


share|improve this question
up vote 5 down vote accepted

Are you sure you aren't looking for something like at.

share|improve this answer
I think you're right! would you mind posting the right syntax? is it "nohup | at now +4 hours &" ? (just a guess, clearly! thanks – user41172 Apr 21 '10 at 22:43
at queues and executes whatever you give it on stdin, so syntax is e.g. 'echo | at now +4 hours'. you don't need nohup with at. see the man page for at for more details. – cas Apr 22 '10 at 0:36

You can use the at (man at) command to do this, and then you don't need the nohup.

If you really wanted to, you could:

nohup bash -c 'sleep 5; command' &

But you might be better off running the command in screen and then use sleep before it so you can easily check the output.

share|improve this answer

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.