{"id":50203080,"url":"https://github.com/samrocketman/clache","last_synced_at":"2026-05-26T00:00:58.530Z","repository":{"id":358499912,"uuid":"1230442953","full_name":"samrocketman/clache","owner":"samrocketman","description":"A CLI based generic CI/CD cache utility intended to create or extract caches from tar streams.","archived":false,"fork":false,"pushed_at":"2026-05-25T03:01:06.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-25T03:25:17.807Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/samrocketman.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-06T02:12:23.000Z","updated_at":"2026-05-25T03:01:10.000Z","dependencies_parsed_at":"2026-05-26T00:00:42.761Z","dependency_job_id":null,"html_url":"https://github.com/samrocketman/clache","commit_stats":null,"previous_names":["samrocketman/clache"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/samrocketman/clache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fclache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fclache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fclache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fclache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samrocketman","download_url":"https://codeload.github.com/samrocketman/clache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocketman%2Fclache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33497930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: 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":[],"created_at":"2026-05-26T00:00:37.948Z","updated_at":"2026-05-26T00:00:58.522Z","avatar_url":"https://github.com/samrocketman.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clache\n\nA CLI based generic CI/CD cache utility intended to create or extract caches\nfrom streams.  Ideal for ephemeral systems where cloud object storage is\navailable to save and restore state across ephemeral nodes.\n\nNo AI was used to create this project.\n\n## Examples\n\nCreate the cache.\n\n```bash\nclache.sh -n -c ~/.m2/repository target | aws s3 cp - s3://your-bucket/file.tar\n```\n\nExtracting the cache from stdin without writing full tar files to disk (a few KB\nof header data gets written during stream inspection).\n\n```bash\naws s3 cp s3://your-bucket/file.tar - | clache.sh -n -e\n```\n\n# Project description\n\n[clache.sh](clache.sh) is intended for CI systems to be able to create and\nextract a cache using streams.  Use case would be a cloud object store\ndownloading a file and streaming the download into this script.  This script\nthen handles all extraction via stdin without writing large tar files to disk.\n\nCreate cache strategy: Files and folders that will be added to the cache will be\nbroken up into two tar commands.\n\n1. `sudo tar` (sudo can be opt-out) from the system root when full paths are\n   given for permissions preservation.  If you have an ephemeral system which\n   does not allow `sudo tar`, then use the `--nosudo` option documented below.\n2. Non-sudo tar for file paths relative to the current working directory.\n\nExtraction happens in the same two phases:\n\n1. `sudo tar -xC /` for full path names.  `--nosudo` means just `tar -xC /` is\n   run.\n2. `tar -x` for relative path names.\n\n# Creating tars without clache.sh script\n\nIf you create the outer and inner tar files without this script, then tar\nfiles should always be created with one of the following commands.\n\n    tar --format ustar -c ...\n    tar --format pax -c ...\n\nExpected tar layout:\n\n    your-cache.tar\n      |- os-cache.tar - the sudo-created tar file.\n      |- pwd-cache.tar - working directory tar file.\n\n# Tar support\n\nOnly ustar and pax(ustar) file formats supported. See [opengroup pax\npublication].\n\n- BSD tar supported.\n- GNU tar supported.\n\n\u003e _Note: both bash and tar (i.e. `apk add bash tar`) on alpine Linux do not\n\u003e appear to support critical features used by this script.  I may try to figure\n\u003e out how to widen compatibility further in the future but for now alpine Linux\n\u003e is not supported._\n\n# Help doc\n\n`./clache.sh -h` results in the following.\n\n```\nclache.sh [--nosudo] --extract \u003c tar-to-extract.tar\nclache.sh [--nosudo] --create FILE... \u003e tar-to-create.tar\n\nDESCRIPTION\n  Create or extract cache using tar.  Provide both relative or full path names\n  to create the cache and it will later be restored.\n\nOPTIONS\n  --create FILE..., -c FILE...\n    Writes archive to stdout.  Creates a cache.  Provided on or more FILE to\n    add to the cache.  Can be relative of full paths.\n\n  --extract, -e\n    Reads a tar file from stdin.  Extracts the cache.\n\n  --nosudo, -n\n    When creating or extracting an archive the full path archive can execute\n    tar without sudo.\n\n  -l DIR, --large-dir DIR\n    Customize where intermediate tar file can be written.  Sometimes the\n    intermediate tar file can be significantly larger than available /tmp file\n    space.  Default: /tmp mktemp directory.\n\n  --help, -h\n    Show help.\n```\n\n[opengroup pax publication]: https://pubs.opengroup.org/onlinepubs/009695399/utilities/pax.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamrocketman%2Fclache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamrocketman%2Fclache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamrocketman%2Fclache/lists"}