# Remove old files
`remove-old-files` is simple utility to clear folder for example with daily database dumps and leave only 3 newest.
```bash
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
```bash
remove-old-files -x 3D -o /dumps
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/alda78/remove-old-files",
"name": "remove-old-files",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "",
"keywords": "",
"author": "Ales Adamek",
"author_email": "alda78@seznam.cz",
"download_url": "https://files.pythonhosted.org/packages/9a/c2/80290b308ee14f9d26db184e0ba039bac0d97c68456820366c8f594f485a/remove-old-files-1.0.2.tar.gz",
"platform": null,
"description": "# Remove old files\n\n`remove-old-files` is simple utility to clear folder for example with daily database dumps and leave only 3 newest.\n\n```bash\nremove-old-files --help\n```\n```\nusage: remove-old-files [-h] -x REMOVE_OLDER_THAN [-o] [-m FILE_MASK] [-d] folder\n\nRemoving files from folder which have modify file date older than X days.\n\npositional arguments:\n folder Directory where are files to be removed located.\n\noptional arguments:\n -h, --help show this help message and exit\n -x REMOVE_OLDER_THAN, --older-than REMOVE_OLDER_THAN\n Remove files older than X (s)econds/(m)inutes/(h)ours/(D)ays. Example: 3D for 3 days.\n -o, --only-if-newer Remevove older files than X smhD only if there are any newer files found.\n -m FILE_MASK, --file-mask FILE_MASK\n Regexp matching filenames for removing. Example: \".*-db-dump-.*\"\n -d, --dry-run Dry run, withouth removing files.\n\n```\n\nExample how to leave only 3 days old dumps\n```bash\nremove-old-files -x 3D -o /dumps\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple utility to clear old files from specified folder",
"version": "1.0.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1d05229631f3eae051a3893098e9647c96ffb8bf7146b339267044086c8dabbb",
"md5": "e23c763b5976cd94a4fc6d409ba03a52",
"sha256": "dede51fb1eb80ded9845be3c7424e845c119faa76f9759cd0dfcc31d13f41557"
},
"downloads": -1,
"filename": "remove_old_files-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e23c763b5976cd94a4fc6d409ba03a52",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 3897,
"upload_time": "2023-03-21T12:44:32",
"upload_time_iso_8601": "2023-03-21T12:44:32.359970Z",
"url": "https://files.pythonhosted.org/packages/1d/05/229631f3eae051a3893098e9647c96ffb8bf7146b339267044086c8dabbb/remove_old_files-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9ac280290b308ee14f9d26db184e0ba039bac0d97c68456820366c8f594f485a",
"md5": "93e3eb597034ef14b471c62ee7d57682",
"sha256": "b2594d20ec10254f3c93be773f705bf1e209ad552923609fd41c144baf9dc360"
},
"downloads": -1,
"filename": "remove-old-files-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "93e3eb597034ef14b471c62ee7d57682",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 3669,
"upload_time": "2023-03-21T12:44:33",
"upload_time_iso_8601": "2023-03-21T12:44:33.978851Z",
"url": "https://files.pythonhosted.org/packages/9a/c2/80290b308ee14f9d26db184e0ba039bac0d97c68456820366c8f594f485a/remove-old-files-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-21 12:44:33",
"github": false,
"gitlab": true,
"bitbucket": false,
"gitlab_user": "alda78",
"gitlab_project": "remove-old-files",
"lcname": "remove-old-files"
}