Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of ask (83)

Friday December 13, 2002
07:20 PM

To forget cleaning up file based locks

[ #9451 ]

$ ls -l
total 195024
drwxrws--- 2 jobs jobs 32711168 Dec 13 15:53 lock
-rw-rw-r-- 1 jobs jobs 166871040 Dec 13 15:53 session.db

it's bad news when the directory itself is taking up 32MB.

$ ls -F lock | wc -l

Oops. Where did that crontab go again?

  - ask

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I did that once a long time ago.

    What's the best way to delete those files? I remember it took forever to delete them all.


    • I don't think there's a super fast way. Put

          find /path/ -type f -mtime +7 | xargs rm

      or something like that into your nightly crontab to make it not go out of control. Or use a different filesystem, like MySQL.

        - ask

      -- ask bjoern hansen [], !try; do();

      • But directories don't shrink. So you'll still be left with a 32Mb directory. The best way to do this is mv lock lock.old && mkdir lock. Then you can delete the lock.old directory at your leisure.

        Of course, this assumes you can get the system into a quiescent state... If not, your way is far superior. :-)