-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
I'm just a little confused, please advise if I'm doing something wrong. My understanding is that flock should CREATE a file to lock if it doesn't exist, but nothing is ever created. From man page: "It locks a specified file or directory, which is created (assuming appropriate permissions), if it does not already exist."
I'm trying to only run a script from cron if a lock cannot be acquired in order to avoid running it if it is already running (because it creates incoming connections to a server).
I have this in crontab:
* 10 * * * /usr/bin/flock -n /tmp/somescript.lockfile sh /Users/me/somescript.sh
I'm on Mac OSX mojave, 10.14.6.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels