I'm running some long running tasks (15 minutes up to a day) in Ubuntu 18.04 under WSL2, itself under Win11.
A couple of times my terminal has stopped responding and never came back, but I could see from resource usage that the task was still running.
How can I best start this task so it's a background task that will persist even if my interactive session ends prematurely?
Important requirements are:
- The task must be running in the background
- I should be able to reconnect to the session if something happens to it
- Output should be logged somewhere in case I don't reconnect in time
- The task is resource intensive, so the method of starting it should not decrease performance substantially
- Ideally I should be able to do all of the above locally as well as over SSH
Just in case it's important, the actual task is a tensorflow job running under python 3.9, within an anaconda environment.