About Time-consuming Scripts or Commands on Remote Servers

Using screen utility you can start some time-consuming command on a remote server and then leave it running there while closing the SSH connection.

Install it to remote Ubuntu Linux server with:

1
$ apt-get install screen

On that server, start a new bash window with:

1
$ screen

Then start any time-consuming script or command.

While it's running, detach the window with:

Ctrl + A, Ctrl + D

Now you can log out or exit the SSH connection.

After a while, connect to the server and get back to long-running command with:

1
$ screen -r

To exit the screen window completely type:

1
$ exit

Tips and Tricks Dev Ops Bash SSH Screen