How to keep command running after SSH session close


Often it’s required to run some heavy command task on server and leave it for hours. This will result in requirement to keep the SSH connection open. There are a couple of solutions, but I want to tell you about one really simple which I prefer to use.

So, how to run the command:

  • SSH to your server
  • Run screen command
  • Run your ‘heavy’ command as usual
  • Press Ctrl-A, Ctrl-D
  • Now command will be detached from current active SSH session
  • That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *