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?
Thanks!
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.
You could create another shell script that does the sleep then runs your command.
cat > x.sh sleep 5 yourcommand.sh ^D nohup x.sh &