Hi!

I’ve a cronjob that I don’t want to be concurrent but it needs to leave a long-running process after it does it’s job that I set up with a nohup command.

The deal is that once the script has setup the lock doesn’t get released so any further calls to the script just get ignored.

Is there a better alternative/flag I’d use? I couldn’t discern much from the flock or nohup man pages.

Solved: With bit more fiddling found the - u flag on the flock man page. You can unlock yourself at the very end of the script.

  • Gonzako@lemmy.worldOP
    link
    fedilink
    arrow-up
    2
    ·
    4 days ago

    Yes! I found the - u flag on flock and that got it working. Thanks for the attention anyway.