I have a question concerning with cron job. this is my code sample:
00 7-20 * * * /home/usr/./test.sh # test.sh is an executable file
The code runs perfectly. I leave the script on for 4 to 5 hours to see if the script can run without any issue. When I check the process after few hours I see 5 same process running at same time.
I've checked online that flock can "fix" this issue:
I've applied this:
00 7-20 * * * flock -n /home/usr/test.sh -c /home/usr/./test.sh
somehow I got this error: /bin/bash: bad interpreter: Text file busy.
Is there away that I can reduce down the process that only one process is running when I activate my script through cron job? Thanks