Name: limitfiles
Owner: World Wide Web Consortium
Description: File cleanup daemon based on inotify
Created: 2013-12-31 21:23:46.0
Updated: 2017-09-04 06:19:52.0
Pushed: 2014-01-16 16:19:05.0
Size: 192
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Some tools regularly create new files, and never clean them up. limitfiles uses inotify to keep them from getting out of hand.
Python 3.1+ and pyinotify.
# python3 setup.py install
limitfiles reads sections like this from /etc/limitfiles.ini
:
[Example]
directory=/tmp/example
keep=20
max=40
match=\.log$
The section name is the name for this watch; you can use whatever you like.
directory
is the directory to watch with inotify. If you specify a Python regular expression as match
, limitfiles will only keep track of files with matching names.
When the count of watched files hits the number in max
, limitfiles will delete the oldest ones until it gets down to the number in keep
.
You can define as many sections like this as you need.
Refer to the pydoc for command-line options and module documentation.