I've tried this solution to prevent duplicate cronjob from running.
30,31 12 * * * /usr/bin/flock -n /tmp/my.lockfile ~/Desktop/test.sh >> ~/Desktop/test.log 2>&1
and script test.sh
has
#!/bin/bash
for i in {1..40};do
echo "hello$i"
sleep 2
done
Script test.sh
successfully prevented from running at 12:31 but it stops and I want to resume it. How can I make it only suspend, not stopped and resume back? Is it possible?