htaccess: Add what we currently use, spider-protection
[girocco.git] / updatecheck.sh
blob3c1c0c842750f23c0c60acc13e37446ddbdb3e53
1 #!/bin/bash
3 export PATH=/home/pasky/bin:$PATH
5 if [ -e /tmp/gitupdatelock ]; then
6 echo "Locked!" >&2
7 exit 1
8 fi
9 touch /tmp/gitupdatelock
11 # Repack in reverse order, so that forked repositories get repacked first.
12 # That prevents objects from missing, since repack -l will automagically
13 # put the now-going-away objects into the forked repository's object store.
15 cd /srv/git
16 find . -name base_url | cut -c 3- | sed -e 's/\/base_url$//' |
17 while read dir; do
18 # echo "* $dir" >&2
19 if [ -e "$dir"/.nofetch ]; then
20 # echo "+l `date` $dir"
21 (cd "$dir/objects" && [ "$(ls ?? 2>/dev/null)" ] && GIT_DIR=".." git repack -A -d -q)
22 GIT_DIR="$dir" git update-server-info
23 # echo "-l `date` $dir"
24 else
25 # echo "+r `date` $dir"
26 /home/repo/repomgr/update.sh "${dir%.git}"
27 # echo "-r `date` $dir"
29 done 2>&1 | grep -v '^Pack.*created\.$'
31 rm /tmp/gitupdatelock