We have a scheduled job that we want to run on both our macOS and Linux hosts.
On Linux, with systemd we can just use this:
and the job will only execute if the first file exists, and the second file is absent (so we can pause the scheduled job from running, e.g. if we're testing a new version).
Is there an equivalent on macOS? I've seen others achieve a similar result by using Bash and just running `[[ -f /etc/this_file_must_exist ]] && run_my_job`` but this seems... not to be the ideal way.
launchd.plist's manpage (https://www.manpagez.com/man/5/launchd.plist/ -- official link seems down) has
KeepAlive but that's for keeping the service up, not preventing it from starting.