Skip to content

File not created? #28

@m3ldis

Description

@m3ldis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions