Nathan Genetzky
2020-06-20
Joey Hess really likes git.
apt-get install git-annex
# Ignore everything
*
# But descend into directories
!*/
# Recursively allow files under subtree
!/subtree/**
Simple Recommendation: Default to MD5E
$ touch a a.b a.b.c a.b.c.d
$ git-annex add .
add a ok
add a.b ok
add a.b.c ok
add a.b.c.d ok
$ git-annex lookupkey *
SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.b
SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.b.c
SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.c.d
# Find mp3 files in either of two repositories that have less than 3 copies:
git annex find \
--not --exclude '*.mp3' --and \
-\( --in usbdrive --or --in archive -\) --and \
--not --copies 3
(A)
camera is “source” of photos
(B)
laptop connected to camera is “client”
(C)
external hard-drive is “archive”
(D)
web server is “public”
(A)->(B)
: Always
(B)->(C)
: if file is placed in “archive/” directory
(B)->(D)
: if file is placed in “public/” directory