#!/bin/bash
for dir in /home/jack/git_mirror/*; do
if [ -d "$dir" ]; then
cd $dir
if [ -d "refs" ]; then
/usr/bin/git fetch -p origin &> /dev/null
if [ $? -ne 0 ]; then
echo "$dir: fetch failed"
fi
/usr/bin/git push --mirror &> /dev/null
if [ $? -ne 0 ]; then
echo "$dir: push failed"
fi
fi
fi
done