Reputation:
I have this cronjob, that is not working for some reason, but I don't entirely understand what it does, could someone explain?
flock -n /var/www/vhosts/SOMEDOMAIN/scripts/blia_bab_import.sh.lock /bin/bash /var/www/vhosts/SOMEDOMAIN/scripts/blia_bab_import.sh
I googled that flock is supposed to lock the file and only run if it can lock the file, so that the job cannot run multiple times at the same time.
What does the -n do?
flock -n
Why is this a .lock file?
/var/www/vhosts/SOMEDOMAIN/scripts/blia_bab_import.sh.lock
I have no idea what the /bin/bash is supposed to do?
/bin/bash
Is this the script I want to execute? Why is it added as a .lock first?
/var/www/vhosts/SOMEDOMAIN/scripts/blia_bab_import.sh
Upvotes: 1
Views: 1275
Reputation: 8621
flock -n LOCK-FILE COMMAND
In your case:
Upvotes: 4