S3 isn't the only way to backup your store. We can already write to a local directory, but what I envision are sync hooks.
For sync-to:
- cabal-cache writes the to be synced artifacts into a temp dir
- It CDs to that directory
- It invokes the sync hook
- It cleans up the directory
For sync-from:
- it writes a file that contains all the artifact names that should be pulled (one artifact per line) to a temporary location
- It creates another temporary directory and CDs into it
- it invokes the hook with the filename as the first argument and expects the hook to sync to the current directory
- it merges the files to the cabal store
- It cleans up all the dirs
Then we would have two scripts per hook. E.g. we would have for rsync:
~/.config/cabal/cache/hooks/rsync/from.sh
~/.config/cabal/cache/hooks/rsync/to.sh
And you would invoke cabal-cache like so: cabal-cache sync-to --method=rsync.
S3 isn't the only way to backup your store. We can already write to a local directory, but what I envision are sync hooks.
For
sync-to:For
sync-from:Then we would have two scripts per hook. E.g. we would have for rsync:
~/.config/cabal/cache/hooks/rsync/from.sh~/.config/cabal/cache/hooks/rsync/to.shAnd you would invoke cabal-cache like so:
cabal-cache sync-to --method=rsync.