Cron tasks, duplicate executions

I’m trying to use cron to automate a daily reboot. Having mixed success.

Putting scripts in /etc/cron.daily is working for logrotation as the /etc/crontab contains:

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

but when I attempted to run my own script using:

20 18     * * *   root    /usr/bin/flock -xn /eio-data/eio-reboot.lck -c /usr/src/app/reboot.bash >> /eio-data/log/reboot-cron.log 2>&1

I found that the script could run multiple times (up to 13 times) with the use of flock, and of course the reboot initiated by

/usr/bin/curl -X POST --silent --fail --show-error --header "Content-Type:application/json" \
    --data '{"force": true}' \
    "$BALENA_SUPERVISOR_ADDRESS/v1/reboot?apikey=$BALENA_SUPERVISOR_API_KEY" 

would still run at least twice, with less than a second between invocations, and the flock file would be left behind.

I’ve checked that I have only one copy of the cron rule in /etc/crontab, have only one cron process running, and I’ve logged both the output from cron and from the script.

Suggestions for fixing the flock file problem? Is my only recourse to add an rm /eio-data/eio-rebook.lck to my make docker command (script)?