{"id":47681043,"url":"https://github.com/cego/zfs-cleaner","last_synced_at":"2026-04-02T13:59:32.854Z","repository":{"id":41190255,"uuid":"89236433","full_name":"cego/zfs-cleaner","owner":"cego","description":"Tool for destroying ZFS snapshots after predefined retention periods","archived":false,"fork":false,"pushed_at":"2024-03-12T11:31:39.000Z","size":97,"stargazers_count":6,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T06:51:03.383Z","etag":null,"topics":["zfs","zfs-autosnapshot-rotation","zfs-backup","zfs-snapshots"],"latest_commit_sha":null,"homepage":null,"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/cego.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":"2017-04-24T12:15:45.000Z","updated_at":"2023-08-21T07:03:31.000Z","dependencies_parsed_at":"2024-06-19T06:14:20.247Z","dependency_job_id":"50e427f1-8e5a-431c-8810-2fb3795d6482","html_url":"https://github.com/cego/zfs-cleaner","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/cego/zfs-cleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego%2Fzfs-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego%2Fzfs-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego%2Fzfs-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego%2Fzfs-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cego","download_url":"https://codeload.github.com/cego/zfs-cleaner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego%2Fzfs-cleaner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["zfs","zfs-autosnapshot-rotation","zfs-backup","zfs-snapshots"],"created_at":"2026-04-02T13:59:32.666Z","updated_at":"2026-04-02T13:59:32.847Z","avatar_url":"https://github.com/cego.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WARNING\nThis is alpha quality software and will probably destroy all your ZFS pools\nand kill your dog. Use with caution.\n\n# zfs-cleaner\n\nzfs-cleaner is a simple tool for destroying ZFS snapshots after predefined\nretention periods. It aims to do one thing only - and do it well.\n\n## Installation\n\nIf you have a working Go environment, it should be as simple as:\n\n    go install github.com/cego/zfs-cleaner\n\n### Installation from pre-built package\n\nBinary releases are available here: https://github.com/cego/zfs-cleaner/releases\n\n## Common usage scenario\n\nzfs-cleaner was developed to assist in an environment where ZFS snapshots is\nused as backup. Snapshots is transferred to remote hosts. Different\nretention policies must be applied to senders and receivers.\n\nA common pattern used at CEGO is having application servers perform ZFS\nsnapshots often, and use `zfs send` to transfer snapshots to a remote backup\nhost.\n\nOn the application server itself it is often desired to only keep a few\nsnapshots for space saving. On the receiving backup host, it is often preferred\nto have longer retention. zfs-cleaner should solve both cases.\n\n## Configuration\n\nzfs-cleaner is configured through a configuration file resembling the nginx\nconfiguration format without semicolons.\n\nA configuration consists of one or more *plans*. A plan defines how to clean\none or more ZFS datasets.\n\nA plan is defined like this:\n\n    plan planA {\n        path pool/dataset1\n        path pool/dataset2\n\n        keep latest 2\n\n        keep 1m for 2h\n        keep 1h for 2d\n    }\n\n    plan planB {\n        path pool/dataset3\n\n        keep latest 10\n        protect \u003c/etc/zfs-cleaner.protected\n    }\n\n    plan planC {\n        path pool/dataset4\n\n        keep 0s for 1h\n        protect synced_to_remote\n    }\n\n*planA* will keep snapshots one minute apart for two hours and one hour apart\nfor two days. This will be applied to the dataset *pool/dataset1* and\n*pool/dataset2*. Besides that the latest two snapshots will be kept.\n\n*planB* will keep the ten latest snapshots from *pool/dataset3* - but never\ndestroy any snapshot name read from `/etc/zfs-cleaner.protected`.\n\n*planC* will keep all snapshots for an hour, and any snapshot named\n`synced_to_remote` will be kept forever.\n\nPath must refer to one of the results from `sudo zfs list -t filesystem -o name`.\n\n#### Including configuration files\n\nA configuration file can include other configuration files using the `include `keyword.\n\n    plan planC {\n        path pool/dataset\n\n        keep 0s for 1h\n        include common.conf\n    }\n\n    include /etc/zfs-cleaner.d/*.conf\n\n`include` is interpreted as a Bash-style glob.\n\n### Units\n\nAll periods consits of a positive integer and a unit. A special case is `0s`\nwhich when used as a frequency means \"everything\". The Following units are\nsupported:\n\n| Unit | Description    |\n|------|----------------|\n| `s`  | Second         |\n| `m`  | Minute         |\n| `h`  | Hour           |\n| `d`  | Day (24 hours) |\n| `y`  | Year           |\n\n### Command line arguments\n\nzfs-cleaner has a single mandatory argument. The path to a configuration file.\n\nA few flags are provided as well.\n\n| Short | Long           | Description                                                                               |\n|-------|----------------|-------------------------------------------------------------------------------------------|\n| `-n`  | `--dryrun`     | Do nothing, print what could have been done.                                              |\n| `-v`  | `--verbose`    | Do everything, print what's done.                                                         |\n| `-V`  | `--version`    | SHow version and exit (can be used with -v)                                               |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcego%2Fzfs-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcego%2Fzfs-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcego%2Fzfs-cleaner/lists"}