Automatically drop large file that are backuped (git-annex)

Problem: a box is running out of free disk space. The contents are under control of git-annex. Automatically find and drop all large files that are properly backed up elsewhere.

#!/bin/bash

my_annex="$HOME/annex"
cd $my_annex
let my_number=2+`echo $my_annex | tr "/" " " | wc -w`
for i in `find $my_annex -xdev -size +5M | grep -v \.pack$`; do
  j=`basename $i`
  k=`find $my_annex -xdev -lname "*$j"`
  to_drop=`echo "$k" | cut -d "/" -f $my_number- `
  if [[ -n $to_drop ]] ; then
      git-annex drop "$to_drop"
  fi
done

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