Welcome to WebmasterWorld Guest from 54.159.41.146

Forum Moderators: bakedjake

Message Too Old, No Replies

Run a Command and Exit SSH

     

HoboTraveler

2:52 pm on Jan 3, 2008 (gmt 0)

10+ Year Member



Hello,

I login to the server over SSH.

I am looking for a way that would allow me to run a command and then be able to exit SSH.

$ php script.php

The ampersand after the command does not work. The command goes into the background allright. However, the command terminates after I close the SSH window.

Any ideas and tips appreciated.

Thanks.

timster

4:19 pm on Jan 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can try using the screen command.

[rackaid.com ]

lammert

6:47 pm on Jan 3, 2008 (gmt 0)

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



You can use the nohup (no hangup) command for this.

For example:

nohup php script.php &

Output and error messages are automatically placed in the file nohup.out in the current directory.

wheel

5:02 pm on Jan 4, 2008 (gmt 0)

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I use the screen command myself in this situation.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month