79377847

Date: 2025-01-22 13:23:20
Score: 0.5
Natty:
Report link

If you want to execute your second task every time the first one is not running, the answer suggested by tink works:

watch -n 1 'pgrep <name of task1> || <task2>'

However, I wanted to run task2 only once as soon as task1 was finished. So I used:

watch -n 1 -g 'pgrep <name of task1>'; <task2>
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: n0dus