Halevt + git-annex = Auto-syncing with encrypted usb-stick

<!-- Mount encrypted usb-stick viking -->
<halevt:Device match="hal.info.udi = /org/freedesktop/Hal/devices/volume_uuid_9f31ebed_4cfa_43c8_bf79_b2ac2ced0199">
   <halevt:Insertion exec="x-terminal-emulator -e cryptmount viking; auto-sync.sh viking"/>
</halevt:Device>
#!/bin/bash

## This is auto-sync.sh

logger "auto-sync called to sync $1 with origin"

## Commit origin and sync to $1
cd ~/annex
git-annex sync $1

## Now, accept what origin pushes.
cd ~/$1/annex
git-annex sync origin

## That was the _records_ of the files. Now, get _content_ of new files that is not
## satisfactory backed up

git-annex --auto get .
logger "$1 is now in sync with origin"

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: oktober 17, 2019