3 #==============================================================================
5 # File ID: f1ca60b4-d33a-11e2-a3c0-0800274013ad
7 # Execute command in all local git-annex repositories
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #==============================================================================
16 if test "$1" = "--version"; then
17 echo $progname $VERSION
21 if test "$1" = "-h" -o "$1" = "--help"; then
24 Execute command in all local git-annex repositories
26 Usage: $progname [options]
31 Execute git-update-dirs in the **/annex directories instead of the
34 Display the number of loose objects in annex repositories in sorted
37 Only run git-update-dirs in annex repositories named X.
39 List files in all annexes that have more copies than necessary.
40 Lists locations too, to get only the file names with number of
41 copies, filter through "grep ^whereis".
43 Execute ./lag_gadu-local * in all top annex/ directories. Uses
46 Loop through all local annexes under /media/*/annex/, sorted by
47 descending free space, and run "make getnew" there, i.e. ga-getnew
48 on all directories with new changes, i.e. "ga get --auto", i.e. "git
53 Print version information.
63 echo $progname: $dir: chdir error
>&2
66 ga info
--fast --bytes |
grep "^available local disk space:" |
71 if [ "$1" = "--gadu" ]; then
72 git update-dirs ~
/annex
/media
/*/annex \
74 -e "sess ./lag_gadu-local *" \
75 -e "git add .gadu-local" \
82 if [ "$1" = "--annex" ]; then
86 if [ "$1" = "-D" ]; then
88 echo annex-cmd
: Missing argument
for -D >&2
95 if [ "$1" = "--get" ]; then
97 for f
in /media
/*/annex
; do
98 test -d "$f" ||
continue
99 free_space
="$(annex_free "$f")"
100 test -z "$free_space" && {
101 echo $progname: $f: No annex information found
>&2
104 test $free_space -le 4096 && {
105 echo -n "$progname: $f: Skipping annex, " >&2
106 echo only
$free_space bytes free
>&2
110 done |
sort -rn | cut
-f 2- -d ' ' |
while read d
; do
113 echo $progname: Get files to
$d >&2
114 cd "$d" && make getnew ||
exit 1
120 if [ "$1" = "--count-loose" ]; then
121 git update-dirs
/media
/*/annex
/$wildc $HOME/annex
/$wildc \
125 find .git/objects -type f | grep -v -e pack -e info | wc -l
131 if [ "$1" = "--find-extra" ]; then
132 git update-dirs ~
/annex
/$wildc \
135 -e 'git update-dirs -Fg . >/dev/null' \
136 -e 'ga whereis --copies=semitrusted+:$(
137 echo $(ga numcopies) + 1 | bc
142 git update-dirs
/media
/*/annex
/$wildc $HOME/annex
/$wildc "$@"
144 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :