{"id":17034526,"url":"https://github.com/vimalloc/apfs-auto-snapshot","last_synced_at":"2025-07-08T20:37:40.412Z","repository":{"id":140701249,"uuid":"104816708","full_name":"vimalloc/apfs-auto-snapshot","owner":"vimalloc","description":"Tool to automatically create and delete APFS snapshots","archived":false,"fork":false,"pushed_at":"2017-09-29T00:01:37.000Z","size":54,"stargazers_count":28,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T17:26:21.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vimalloc.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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,"zenodo":null}},"created_at":"2017-09-26T00:42:04.000Z","updated_at":"2024-05-04T14:08:27.000Z","dependencies_parsed_at":"2024-07-09T18:00:35.635Z","dependency_job_id":null,"html_url":"https://github.com/vimalloc/apfs-auto-snapshot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vimalloc/apfs-auto-snapshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalloc%2Fapfs-auto-snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalloc%2Fapfs-auto-snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalloc%2Fapfs-auto-snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalloc%2Fapfs-auto-snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vimalloc","download_url":"https://codeload.github.com/vimalloc/apfs-auto-snapshot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimalloc%2Fapfs-auto-snapshot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264344632,"owners_count":23593938,"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":[],"created_at":"2024-10-14T08:43:52.252Z","updated_at":"2025-07-08T20:37:40.407Z","avatar_url":"https://github.com/vimalloc.png","language":"Haskell","readme":"# apfs-auto-snapshot\nTool to automatically create and delete APFS snapshots on a sliding timeline.\n\n# Shows Stopping Limitation\nSomething (I'm guessing Time Machine) deletes snapshots out from under us. As\n`tmutil` seems to be the only way to make APFS snapshots at the moment, there\nisn't much that can be done about this I fear. See [#1](/../../issues/1) for\nthe details. \n\nAs it stands, I can't get more then 4 or 5 snapshots at a time\nbefore the invisible hand steps in and starts deleting older backups.\nUnless this is fixed or we find a new way around this, the sliding window\nfeature of this project is basically unusable, and it would be simplier to\njust cron new snapshot creations with `tmutil`. Just don't expect them to\nstick around.\n  \n### Current Status\nUntil the show stopping limitations get fix, this project is basically stalled. \nHowever, if we can get around that issue, development on this will continue in\nfull force. The project is not solidified at all, everything in it is prone to\nchange going forward.\n\n### Gotchas\nWhen using APFS snapshots, if you delete a file and it is still in your snapshot,\nyou will not get the space back from that file until all the snapshots that contain\nthat file have been deleted. You can manually delete snapshots using `tmutil`.\nPerhaps there is a way to mount snapshots as Read/Write (like in BTRFS) so you\ncan remove only the deisred file instead of the entire snapshot, but I haven't\nseen any information about this as of yet.\n\n### Contributing\nContributions are 100% welcome! I am ususally hanging out on freenode, feel\nfree to PM me (vimalloc) if you want to discuss anything :)\n\n### Running\n* Make sure haskell is installed\n* Clone this repo somewhere\n* Wherever you cloned the repo, run `cabal sandbox init`\n* Install the dependencies with `cabal install --only-dependencies`\n* Run `cabal build` or `cabal run`\n\nYou can restore files from the created snapshots by using time machine.\n\n\nIf you want to have this work on a schedule, here is a quick and dirty crontab\nyou could use until something better is put in place. Note that this may\nbreak out from under you as development continues on this project:\n```cron\n# NOTE: Make sure you properly set APFS_AUTO_SNAPSHOT_DIR to wherever you cloned\n#       this project to\n\nAPFS_AUTO_SNAPSHOT_DIR=/Users/lgbland/code/apfs-auto-snapshot\n\n# Run on the first day of the year at midnight\n0 0 1 1 * cd $APFS_AUTO_SNAPSHOT_DIR; dist/build/apfs-auto-snapshot/apfs-auto-snapshot --quater-hourly --hourly --daily --monthly --yearly \u003e /tmp/autosnap.log 2\u003e\u00261\n\n# Run on the first day of the month for every month except january first (handled by yearly)\n0 0 2-12 1 * cd $APFS_AUTO_SNAPSHOT_DIR; dist/build/apfs-auto-snapshot/apfs-auto-snapshot --quater-hourly --hourly --daily --monthly \u003e /tmp/autosnap.log 2\u003e\u00261\n\n# Run weekly on sunday\n0 0 * * 0 cd $APFS_AUTO_SNAPSHOT_DIR; dist/build/apfs-auto-snapshot/apfs-auto-snapshot --quater-hourly --hourly --daily --weekly \u003e /tmp/autosnap.log 2\u003e\u00261\n\n# Run daily at midnight, except for sunday as that is handled above by weekly\n0 0 * * 1-6  cd $APFS_AUTO_SNAPSHOT_DIR; dist/build/apfs-auto-snapshot/apfs-auto-snapshot --quater-hourly --hourly --daily \u003e /tmp/autosnap.log 2\u003e\u00261\n\n# Run hourly, excpet at midnight which is handled by one of the above jobs\n0 1-23 * * * cd $APFS_AUTO_SNAPSHOT_DIR; dist/build/apfs-auto-snapshot/apfs-auto-snapshot --quater-hourly --hourly \u003e /tmp/autosnap.log 2\u003e\u00261\n\n# This will run on only the quater (that isn't already handled by an above job)\n15,30,45 * * * * cd $APFS_AUTO_SNAPSHOT_DIR; dist/build/apfs-auto-snapshot/apfs-auto-snapshot --quater-hourly \u003e /tmp/autosnap.log 2\u003e\u00261\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimalloc%2Fapfs-auto-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvimalloc%2Fapfs-auto-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimalloc%2Fapfs-auto-snapshot/lists"}