Simple utility to clear old files from specified folder
Project description
Remove old files
remove-old-files
is simple utility to clear folder for example with daily database dumps and leave only 3 newest.
remove-old-files --help
usage: remove-old-files [-h] -x REMOVE_OLDER_THAN [-o] [-m FILE_MASK] [-d] folder
Removing files from folder which have modify file date older than X days.
positional arguments:
folder Directory where are files to be removed located.
optional arguments:
-h, --help show this help message and exit
-x REMOVE_OLDER_THAN, --older-than REMOVE_OLDER_THAN
Remove files older than X (s)econds/(m)inutes/(h)ours/(D)ays. Example: 3D for 3 days.
-o, --only-if-newer Remevove older files than X smhD only if there are any newer files found.
-m FILE_MASK, --file-mask FILE_MASK
Regexp matching filenames for removing. Example: ".*-db-dump-.*"
-d, --dry-run Dry run, withouth removing files.
Example how to leave only 3 days old dumps
remove-old-files -x 3D -o /dumps
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
remove-old-files-1.0.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for remove_old_files-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 156a9550a6568227de3cd457f200df2f84e8a9465582347bd03e1fbcc22369a4 |
|
MD5 | 56bb97e066516d23b48467798a7149d0 |
|
BLAKE2b-256 | de0f6d1494c0a020bf79c8b9dea484a6097656168ae31b44a910a98f58ee7d1a |