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.1.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

dir_clean-0.1.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dir_clean-0.1.2.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.1.2.tar.gz
Algorithm Hash digest
SHA256 61c8535164f357d46615032323081606c061c9df414e74b87a0d59ded49caf97
MD5 2cb8eea5cd649842092dee43e1b1fc74
BLAKE2b-256 e590fa47156a4dd8fe36c141e7d7f5d98351204d6b3ff142090c6aa953d44ca4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dir_clean-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ee3046fc81f1d06f3a821e2e269134833f0b3fd523c88ba8f6ff83bcfaaba65d
MD5 b14d6d0083f7c9159e7bc8b4f553efc2
BLAKE2b-256 5f3589f0d1b2d0589eab30e8861fb57fa18eb34dcd6f60c64aca3dd441a338da

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