#!/bin/sh
set -e
if [ $(hostname) != gombert ] ; then
	echo 'This script must be run on gombert.debian.org only' > /dev/stderr
	exit 1
fi
mkdir -p /home/pabs/gobby-export
cd /home/pabs/gobby-export
rsync --delete --archive --exclude .git /srv/gobby.debian.org/export/ ./
test -d .git || git init
git add .
if ! git diff --quiet --cached ; then
        echo Gobby export:
        echo
        git diff --cached
        echo
        echo End of gobby export
fi
git commit -q -m "Import $(date --rfc-3339=seconds)" > /dev/null || true

