Questions tagged [lockfile]

4 questions
2
votes
1 answer

How do I properly use flock(2) with a cron script?

I am using a crontab to execute a php script that retrieves data and writes it to a database. My crontab entry looks like: * * * * * php /path/to/file/fileName1.php * * * * * php /path/to/file/fileName2.php ... you get the point I'd like to use…
Moxtheox
  • 23
  • 2
1
vote
1 answer

How can I get Certbot to run after unresponsive login session?

A login session (under Jessie) running certbot -d example.com -d www.example.com froze, and when I tried to run Let's Encrypt's certbot from another session, it said, "Another instance of Certbot is already running." I did a kill -HUP on the…
Christos Hayward
  • 1,152
  • 3
  • 15
  • 35
1
vote
0 answers

Why lock on a file shared over SMB taking only 3 microseconds?

I used the following C++ functions to lock 1 byte of a file that is shared by server via SMB: On Windows: LockFileEx (h, LOCKFILE_FAIL_IMMEDIATELY | LOCKFILE_EXCLUSIVE_LOCK, 0, 1,0, &overlapped) On Linux and Mac OS: fcntl (fd, F_SETLK,…
0
votes
0 answers

Lock File deletion and recreation after 5 mins. Beginner Bash need help making script work properly

Below is the LockFile part of my script. Lockfile should remove and recreate after 5 mins automatically as the script is set to run every 5mins to check to be sure the services on the server are running. Lockfile is created but not removed after 5…