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
Metadata
Release files for dir-clean 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dir_clean-0.1.4.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dir_clean-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / dir_clean-0.1.4.tar.gz
| Download URL | dir_clean-0.1.4.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95a91656a6e3e242630f0f8666de96cb7a58d00f28d06a5797b3e567b164047f
|
|
BLAKE2b-256 checksum How to use checksums |
fa7419cc708a04a42f2e7b360598a8b4fa97fa7abb5c4f75568a61f72d47717f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / dir_clean-0.1.4-py3-none-any.whl
| Download URL | dir_clean-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b54349df6ebe5931bfebd484e4413db3fcfe7af4f3b8ae30e31fb539a7e5afc
|
|
BLAKE2b-256 checksum How to use checksums |
05465be779bcb774229022dc7e44e98e013bd2e3f18bb8e21760621f5882d9c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|