Skip to main content

This package can help you to clean up the directory.

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: dir_clean-0.1.4.tar.gz
  • Upload date:
  • Size: 3.7 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.4.tar.gz
Algorithm Hash digest
SHA256 95a91656a6e3e242630f0f8666de96cb7a58d00f28d06a5797b3e567b164047f
MD5 a06d0b46de309f80c7a608b139fab690
BLAKE2b-256 fa7419cc708a04a42f2e7b360598a8b4fa97fa7abb5c4f75568a61f72d47717f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dir_clean-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1b54349df6ebe5931bfebd484e4413db3fcfe7af4f3b8ae30e31fb539a7e5afc
MD5 b152c277814af6991e0995bdc82daeb9
BLAKE2b-256 05465be779bcb774229022dc7e44e98e013bd2e3f18bb8e21760621f5882d9c0

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