dat icon indicating copy to clipboard operation
dat copied to clipboard

dat backup - save current version to local history storage

Open joehand opened this issue 7 years ago • 6 comments

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:

  • dat share - imports files
  • dat keep - saves current archive version and files to ~/.dat/history/<discKey> as sleep files (i.e. with content.data).

Or

  • dat sync --keep - live import + keep all history

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)

joehand avatar May 15 '17 18:05 joehand

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

okdistribute avatar May 15 '17 18:05 okdistribute

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

okdistribute avatar May 15 '17 18:05 okdistribute

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 avatar May 15 '17 18:05 joehand

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 avatar May 15 '17 19:05 joehand

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

joehand avatar May 18 '17 00:05 joehand

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.

bnewbold avatar Nov 26 '17 02:11 bnewbold