{"id":16332126,"url":"https://github.com/m1kc/autocleaner","last_synced_at":"2025-06-27T02:37:09.442Z","repository":{"id":146805947,"uuid":"423908986","full_name":"m1kc/autocleaner","owner":"m1kc","description":"A program that deletes old files with configurable storage period. It uses `find` internally, and is capable of handling millions of files very quickly.","archived":false,"fork":false,"pushed_at":"2022-06-17T09:44:12.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T21:47:56.947Z","etag":null,"topics":["cleaner","cleanup","housekeeping","ruby","system","systemd","systemd-service","utility"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m1kc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-11-02T15:58:59.000Z","updated_at":"2023-09-21T18:52:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"f35b8dd6-2c60-416b-8b28-1ad158c5ad5e","html_url":"https://github.com/m1kc/autocleaner","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/m1kc/autocleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc%2Fautocleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc%2Fautocleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc%2Fautocleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc%2Fautocleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m1kc","download_url":"https://codeload.github.com/m1kc/autocleaner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc%2Fautocleaner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260705893,"owners_count":23049494,"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":["cleaner","cleanup","housekeeping","ruby","system","systemd","systemd-service","utility"],"created_at":"2024-10-10T23:29:18.969Z","updated_at":"2025-06-19T07:09:47.707Z","avatar_url":"https://github.com/m1kc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# autocleaner\n\nA program that deletes your files with configurable storage period.\nIt uses `find` internally, and therefore it's very fast (and that's\nimportant when you're dealing with millions of files).\n\n:wrench: Quality: **beta** \n \n:cityscape: Used in production since **Nov 2021**\n\n## Requirements\n\n* Ruby 2.0...2.7\n* `find` in PATH\n\n## Install\n\n```sh\ncd /opt\nsudo git clone https://github.com/m1kc/autocleaner.git\ncd autocleaner\nsudo make install\nsudo nano /etc/autocleaner/config.rb  # edit config as you see fit\nsudo make activate  # this will enable and start systemd timer\n```\n\n## Usage\n\nEdit `/etc/autocleaner/config.rb` and define which folders you want to\nbe auto-cleaned and how long to store files inside them.\n\n**Added in v1.1.0:** you can also set :glob parameter to limit the scope\nto files matching the given pattern, like `*.log`, `temp-*`,\nor `*` (all files, default). Note that unlike in bash, `*` matches\ndotfiles as well.\n\n```ruby\nmodule Config\nFOLDERS = [\n\t# Define your folders here.\n\t{ :folder =\u003e \"/tmp\", :days =\u003e 900 },\n\t{ :folder =\u003e \"/var/log/myservice\", :days =\u003e 30 },\n\t{ :folder =\u003e \"/var/log/myotherservice\", :days =\u003e 60, :glob =\u003e \"*.txt\" },\n]\nend\n```\n\nDays are counted from file's _modification time_ (mtime).\n\n**Note:** you **can** define overlapping folders. In such cases, **smallest**\nstorage period wins. In other words, if a file is to be kept by one policy\nand to be deleted by another, it will be deleted.\n\n## Known caveats\n\n* On Ruby 2.0.0p648, the following warning appears: `/etc/autocleaner/config.rb:1:in '\u003ctop (required)\u003e': Use RbConfig instead of obsolete and deprecated Config`. This is harmless and should be ignored.\n\n## Planned features\n\n(for requests, create an issue or drop me a note at m1kc@yandex.ru)\n\n* `--dry-run` flag\n* `--validate-config` flag\n* Deletion of empty folders\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1kc%2Fautocleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm1kc%2Fautocleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1kc%2Fautocleaner/lists"}