run process in background and keep it running after ssh exit [done]

To do so, simply use “disown <pid>” command.

Proceed as follows:

  1. ssh into server
  2. run command and put it in background:
    myprocess.sh &
  3. note the id of the command being returned (or run either “jobs -l” or “ps aux | grep myprocess” to find it back)
  4. run command:
    disown <pid>
  5. exit ssh
  6. ssh into server again
  7. run “ps aux | grep <pid>” should return content

Alternatively use “nohup”: simply prefix your command with “nohup

example:

nohup myprocess.sh &

sources

Post a Comment

Your email is never published nor shared. You're allow to say what you want...


Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

Warning: fsockopen() [function.fsockopen]: unable to connect to www.sweetcaptcha.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81