Operating System - Linux
1753851 Members
8271 Online
108807 Solutions
New Discussion

Re: Locking files from a shell script

 
SOLVED
Go to solution
Klaas D. Eenkhoorn
Regular Advisor

Re: Locking files from a shell script

Thanks,

The ln solution works for me !
Good thinking.

Thanks for the replies.

Kl@@s
dirk dierickx
Honored Contributor

Re: Locking files from a shell script

just for completion, it seems you are creating a script that can be called while the previous execution might still be running, but they cannot run at the same time.

the clean unix way is to use .pid files in the /var/run directory. this file contains the pid of the active running process.

this has several interesting advantages;
- you know there is (still) something running
- it is easy to kill, by just cating the pid file.
- all files are at one location
etc.