w3c/limitfiles

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

Homepage:

Size: 192

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

limitfiles

Some tools regularly create new files, and never clean them up. limitfiles uses inotify to keep them from getting out of hand.

Dependencies

Python 3.1+ and pyinotify.

Installation
# python3 setup.py install
Configuration

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.

Usage

Refer to the pydoc for command-line options and module documentation.

Contact

brett@w3.org


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.