Intro
For long running tasks/scripts you can utilise screen utility to create session, go away and get back to same session and check status. This is ideal toll for example for running long term rsync tasks.
Homepage - https://www.gnu.org/software/screen/
Tips and tricks - https://linuxize.com/post/how-to-use-linux-screen/
Basic usage
Installing
CentOS
yum install screen -y
Ubuntu
apt-get install screen -y
Creating session
screen
And now you can execute your long term running task.
Disconnecting from session
To go away from server and keep task running, you need to detach from screen session using following shortcut:
[Ctrl] + [a]
And then pressing [d].
Connecting back to your session
To see your long term task you need to re-attach to previously created session like this:
screen -r
Terminating session
After finishing that long term activity, you will terminate session by using following shortcut:
[Ctrl] + [d]