'Nohup' Command Is Not Working with 'Watch' Command

'Nohup' Command Is Not Working with 'Watch' Command

I have tried to run nohup watch -n 5 python3 main.py & but it is not working anymore. Is there any way to run watch -n 5 python3 main.py & command in background?

1 Answer

You could just run it in a tmux or screen session and leave it there. Or write a small upstart script fx

description "main"
author ""
start on filesystem and net-device-up IFACE!=lo

exec python3 main.py

and let the main.py handle the iteration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.