Configuration Files

In the /etc/imlcleanup.d/ folder can be several configurations - one per cleanup job.

Example

First of all an example:

dir = /your/starting/path
filemask = *.log,*.gz
maxage = 180
maxdepth =
deleteemptydirs = 1
runas = root

Syntax

  • Variable name starts in first column (no starting spaces)
  • followed by space + “=” + space
  • followed by value without any quoting

Variables

Variable Description Required
dir {string} your starting path for the scan Y
filemask {string} filemask(s) Y
maxage {int} max age of a file in days Y
maxdepth {int} max recursion level n (empty is default = no restriction)
deleteemptydirs {bool} flag (0 or 1) n (0 is default = do NOT delete empty folders)
runas {string} unix user to run n (root is default)

For dir and filemask you can set multiple values: use a comma “,” to separate them.

The not required variables can be absent to use its default.

The runas value can be used to switch into a user context. The scan + deletion then is limited to that user access. It is done with su - [username] -c [command] - so that user needs a login shell.

My First Config File

To start make a copy of the example file in /etc/imlcleanup.d/ and name it [your-task].conf. The extension *.conf will be scanned by default.

Remark: It means by renaming a config to .bak (or whatever) is a simple way to disable a job.