dat-ecosystem / dat

:floppy_disk: peer-to-peer sharing & live syncronization of files via command line
https://dat.foundation
BSD 3-Clause "New" or "Revised" License
8.24k stars 449 forks source link

dat backup - save current version to local history storage #759

Open joehand opened 7 years ago

joehand commented 7 years ago

Add dat keep command and/or --keep option to store the history in a local clone, started in this branch.

The goal would be to have a local copy of history that:

  1. Works offline
  2. Can act as a permanent or temporary backup of history
  3. Store separately from dat files

Usage:

Or

Feel like it'd be good to have a way to:

  1. list what archive versions we have locally
  2. clear local cache of all/specific versions
  3. clear local cache compared to a remote copy (e.g. clear everything locally that your server has backed up)
okdistribute commented 7 years ago

Can we use 'save' instead? It's more common as a word. I'd have a hard time remembering 'keep'

okdistribute commented 7 years ago

PR Looks great too. Do you mean 'opts.keep' here? https://github.com/datproject/dat/compare/save-history#diff-79e323cb6f1d4181aa6b4a04b4c44dc2R66

joehand commented 7 years ago

Can we use 'save' instead? It's more common as a word. I'd have a hard time remembering 'keep'

Yea I started with save but I realized it may be a bit misleading. The files are being "saved" when you do any import (kind of?). To me, it's not clear what difference a dat save command would be from a normal import to archive.

I wanted something that conveyed "keeping"/copying a set of files more than save, which is usually an in-place thing. Does that make sense? Any other words you think may be better? Or should we just do save =)?

joehand commented 7 years ago

PR Looks great too. Do you mean 'opts.keep' here? https://github.com/datproject/dat/compare/save-history#diff-79e323cb6f1d4181aa6b4a04b4c44dc2R66

That shouldn't be in there at all I think? Sorry, commit was a bit of a mess. I think this is where it happens instead: https://github.com/datproject/dat/compare/save-history#diff-c944785912c137a01b4c717d08359723R16

joehand commented 7 years ago

Started updating https://github.com/joehand/dat-backup/tree/new-api

bnewbold commented 6 years ago

I'd still love to see this! Or at least flags to dat init (CLI) which ensures all future added/synced data is saved, and a flag to dat clone that both pulls full history and "checks out" the latest versions to the current folder. I know hypercored has some of this functionality, but I think it's basic enough that it should be possible with dat itself.