Skip to main content

This package starts and looks after your program, based on the configuration.

Project description

dir_clean

This package can help you to clean up the directory.

Files or directories older than the specified number of days will be deleted.

Usage

usage: __main__.py [-h] [-d KEEP_DAYS] [-c CONF_FILE] [--dry-run]

optional arguments:
  -h, --help            show this help message and exit
  -d KEEP_DAYS, --keep-days KEEP_DAYS
                        days to keep (default: 7)
  -c CONF_FILE, --conf-file CONF_FILE
                        configuration filename (default: dir_clean.conf)
  --dry-run

Configuration file format

Each line consists of these items, separated by commas:

  • path: path to search.

  • regex: Regular expression to match directories or files to clean. (optional)

  • days: how many days to keep. (optional)

Example:

/services/www/log,.+,3

Date comparison

By default, the modification date of the file or directory will be read as a comparison with the current date, but you can also specify the date of a file or directory through the regular expression.

/services/www/log,.+?-(?P<m>\d{2})-(?P<d>\d{2})-(?P<y>\d{4})\.log,7

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dir_clean-0.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

dir_clean-0.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file dir_clean-0.0.1.tar.gz.

File metadata

  • Download URL: dir_clean-0.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.9.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

File hashes

Hashes for dir_clean-0.0.1.tar.gz
Algorithm Hash digest
SHA256 cae9b5524b7395dd5cb718add8420fcff9fa2c764df547b660ba4ae13ad73a96
MD5 4f7072b8f1adb2a21202d4618ead0489
BLAKE2b-256 3d9a7aef4d50553bf3cec1e670322c49b71b780aa9cb9e29d76508e6682d53d1

See more details on using hashes here.

File details

Details for the file dir_clean-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dir_clean-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.9.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

File hashes

Hashes for dir_clean-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0bcda7807c1984eb105b07849e88f4614455533f31376fb970f3d99a53df3e7
MD5 f33350c18fdaa39fe967009cd48402f0
BLAKE2b-256 43f0044171a7781fe243e1863daff93c4e35980ecaefaed93884c6639caf4a04

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page