{"id":28656062,"url":"https://github.com/offline-gmbh/scrubber","last_synced_at":"2025-06-13T08:10:14.696Z","repository":{"id":57552532,"uuid":"145229125","full_name":"OFFLINE-GmbH/scrubber","owner":"OFFLINE-GmbH","description":"Scrubber provides an easy way to clean up old files in a directory","archived":false,"fork":false,"pushed_at":"2023-08-24T15:55:23.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-31T10:26:38.075Z","etag":null,"topics":["cleanup","cross-platform","golang","logging","logrotation"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/OFFLINE-GmbH/scrubber","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OFFLINE-GmbH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-18T15:00:42.000Z","updated_at":"2023-08-24T09:21:47.000Z","dependencies_parsed_at":"2024-06-20T09:29:50.767Z","dependency_job_id":"416dfddc-54aa-43cc-b459-0d16dd4f7305","html_url":"https://github.com/OFFLINE-GmbH/scrubber","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/OFFLINE-GmbH/scrubber","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Fscrubber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Fscrubber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Fscrubber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Fscrubber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OFFLINE-GmbH","download_url":"https://codeload.github.com/OFFLINE-GmbH/scrubber/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Fscrubber/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259606992,"owners_count":22883565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cleanup","cross-platform","golang","logging","logrotation"],"created_at":"2025-06-13T08:10:13.966Z","updated_at":"2025-06-13T08:10:14.633Z","avatar_url":"https://github.com/OFFLINE-GmbH.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scrubber\n\n[![Build Status](https://travis-ci.org/OFFLINE-GmbH/scrubber.svg?branch=master)](https://travis-ci.org/OFFLINE-GmbH/scrubber)\n\nScrubber provides an easy way to clean up old files in a directory.\n\nIt is especially useful on platforms where `logrotate` is not easily available or disk space is sparse.\n\n## Configuration\n\nYou can specify directories to clean up in a `toml` configuration file. You can define one or more strategies used for\neach directory.\n\n```toml\ntitle = \"Log scrubber example config\"\n\n[[directory]]\nname = \"Apache Logs\"\npath = \"/var/logs/apache\"\nexclude = [\"zip\"]\n\n    [[directory.strategy]]\n    type = \"size\"\n    action = \"delete\"\n    limit = \"100M\"\n\n    [[directory.strategy]]\n    type = \"age\"\n    action = \"delete\"\n    limit = \"1y\"\n\n    [[directory.strategy]]\n    type = \"age\"\n    action = \"zip\"\n    limit = \"1d\"\n\n[[directory]]\nname = \"Backups\"\npath = \"/var/backups/yourapp\"\ninclude = [\"tar.gz\"]\n\n    [[directory.strategy]]\n    type = \"age\"\n    action = \"delete\"\n    limit = \"1y\"\n```\n\n### Directory\n\nThe following options are available for each `directory`:\n\n| Option      | Description                                                                                                                     |\n|-------------|---------------------------------------------------------------------------------------------------------------------------------|\n| name        | A descriptive name for this directory.                                                                                          |\n| path        | The full path to the directory. Can be a [`Glob` expression](https://pkg.go.dev/path/filepath#Glob) (like `/path/*/subfolder`). |\n| include     | (Optional) Define what files should be included. All files without a matching extension will be ignored.                        |\n| exclude     | (Optional) Define what files should be excluded. All files with matching extension will be ignored.                             |\n| keep_latest | Any , leave the latest `n` files untouched.                                                                                     |\n\nYou can either specify a `include` or a `exclude` rule but never both.\n\n### Strategy\n\nThe following options are available for each `strategy`:\n\n| Option      | Possible values    | Description                                                                                                                                                                                                      |\n|-------------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| type        | `age` and `size`   | If the files should be selected by their `age` (last modified) or their `size`.                                                                                                                                  |\n| action      | `delete` and `zip` | If matching files should be deleted or zipped. The `zip` action will remove the original file. Make sure to also exclude `zip` files from this rule so created zip files won't be cleaned up on subsequent runs. |\n| limit       | A file size or age | Define the max. age as `1y`, `1d`, `2h` or the file size as `1M`, `1GB`, `1000B`. Supported units for the age are `m`, `h`, `d`, `w`, `y`. Supported units for the size are `B`, `KB`, `MB`, `GB`, `TB`, `PB`.   |\n\n## Run\n\nYou can run `scrubber` from the command line. The following options are available:\n\n\n| Param    | Default              | Description                                                   |\n|----------|----------------------|---------------------------------------------------------------|\n| -config  | scrubber.config.toml | The path to your configuration file.                          |\n| -pretend | false                | If specified, scrubber will log actions but not execute them. |\n\n```bash\n# Check your config and see what will be done\n./scrubber -config scrubber.config.toml -pretend\n# Execute the action\n./scrubber -config scrubber.config.toml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffline-gmbh%2Fscrubber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffline-gmbh%2Fscrubber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffline-gmbh%2Fscrubber/lists"}