When I connect via ssh to a terminal at work I need to keep sessions alive to run various scripts. However, I often find that the scripts fail because some directory ceases to exist in the meantime.
For example, I get errors like sh: 0: getcwd() failed: No such file or directory
after a few hours, or The folder you are executing pip from can no longer be found
if I run pip.
How do I go about solving this issue?