06-03-2009 04:47 PM
i was wondering if you could assist me in the following issue. i am trying to run a command remotely via ssh however i want insure the command is running in the background even after the ssh session timesout. basically something like this
ssh user@host "nohup sh ~/command.sh parameter &"
unfortunately this does not work. if kill the session it kills the command. i am i missing anything in the command. please note i would like the ssh session to continue running in the forground until it timesout. is this possible in this case.
Solved! Go to Solution.
06-03-2009 09:59 PM
ssh user@host "nohup /path/command.sh parameter 1>/path/file.out 2> /path/file.out &"
The ssh session will end as soon as the command is triggered, but the command will run in background until it completes.
file.out will keep the stdout and stderr outputs generated out of the command/script.
==> "i would like the ssh session to continue running in the forground until it timesout. is this possible in this case."<== This is not possible.