Periodically run Bash Job A to conditionally restart Bash Job B based on output of Bash Job A
Is there any neater way I can accomplish the task?


        long_proc.terminate()  # kill Bash Job B


Well, sending SIGTERM is effective, but since you're in control of what Job B runs you might prefer to have it do IPC so it gracefully shuts down after completing a processing phase, rather than being interrupted at some arbitrary point. Could be as simple as creating a sentinel /tmp file that B looks for.

A bigger issue is that you're not doing wait4() child, like this:

        long_proc.terminate()
        long_proc.wait()


Instead you wrote a race with a 5-second delay to encourage the child to win. That long sleep implies wasted idle time. You could run the CPU flat out by synchronizing with exiting child.