Ever need to index a large amount of objects overnight but don’t want to leave your computer in the office while is working?  Maybe you have a lot of commands you need to type and if your internet connection goes down, you have to start over from scratch?

Here is a quick and painless way to run a quick script without needing to be logged in while you’re waiting for it to finish.

First, VPN and log into the server you want to run a long process.

Then, enter the following command:

screen -R -D

Next, simply run the script that will take a really long time:

./this_script_will_take_many_days_to_finish.sh

Detach from the proccess with the following keystroke: “CTRL-A D

and logout:

exit

Check the progress

Anytime you want to check the progress of the script:

screen -R -D

And again, use “CTRL-A D” to detach from the process again.

There you go! If you have a long process or you simply want to be able to continue your work even if your internet connection dies, give this a shot!