| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Check for and delete a stale lock file. |
Hi Robert,
Robert Couture wrote to Michiel Broek:
RC> Michiel Broek -> Robert Couture wrote:
RC>
RC> MB> If it's a lockfile with a pid in it you can send a kill -0 to that
RC> pid. The
RC> MB> exitcode of kill will tell if that pid existed or not.
RC>
RC> No, it is a zero byte lock file.
RC>
RC> MB> Else use find with a test on mtime with a certain age, a couple of
RC> hours or
RC> MB> so.
RC>
RC> Could you whip up a quick example to lead me in the right direction?
I have this in one of my cronjobs:
# Remove formatted man pages not accessed in 10 days
/usr/bin/find /var/man/cat? -atime +10 -exec /bin/rm -f {} \; 2> /dev/null
(If it shows wrapped, the above line should be one line).
Look in the manpage for find how to set shorter times. Point /var/man/cat?
to the lockfile.
Greetings, Michiel Broek
Email: mbse{at}mbse.dds.nl
Fidonet: Michiel Broek at 2:280/2802
... But soft, what light through yonder tagline breaks?
--- MBSE BBS v0.71.2 (GNU/Linux-i386)
* Origin: MBSE Linux BBS. Made in the Netherlands (2:280/2802)SEEN-BY: 633/267 270 @PATH: 280/2802 5003 379/1 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.