If the task takes a good amount of time, you have risks of being disconnected from either the SSH session, your internet provider, etc.
To avoid this, I recommended running these scripts (although, I do not recommend running scripts like this at all) using screen. It's super easy to use:
SSH into the desired instance
Start a new screen session using screen
Run the long running script
Press Ctrl + a followed by d to detach the session
You can now close everything, even the SSH session
You can reattach to the screen session using screen -r
Screen has a lot of awesome things, make sure to check out the man page.
If the task takes a good amount of time, you have risks of being disconnected from either the SSH session, your internet provider, etc.
To avoid this, I recommended running these scripts (although, I do not recommend running scripts like this at all) using screen. It's super easy to use:
screen
Ctrl
+a
followed byd
to detach the sessionscreen -r
Screen has a lot of awesome things, make sure to check out the man page.
I actually learned about tmux one time I had to run a script that took hours to finish, total savior <3
Oh man, YES! screen or tmux sessions are a must as well for long-running scripts!
Screen is a must for SSH... or even local if you want to be minimal in your shells.