i have a script called server.sh.
how to run this script in backgroung using nohup command
i have a script called server.sh.
how to run this script in backgroung using nohup command
to run any script in the background use the operator '&'
Usage: server.sh & nohup
The nohup needs to go before the command. You might also want to take care to redirect output to a file (otherwise it goes to nohup.out)
nohup server.sh >server.out 2>&1 &
Any introductory Unix text should explain this.
Hi era,
the code that i have given is ok or not?
Not. But you don't really have to ask; try it.
vnix$ sleep 1 & nohup
nohup: missing operand
Try 'nohup --help' for more information.
(This is bash; if you have a different shell, its output will likely be different.)
Try
$nohup server.sh / &