summaryrefslogtreecommitdiff
path: root/scripts/git-mirror.cron
blob: 311180a03e19ddb9fde8cc4687147512cfafa386 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/bash

[[ $(id -u) -eq 0 ]] && exec sudo -H -u randomdan $0 $@

find /var/git -maxdepth 2 -name config -type f | \
	xargs grep -F '[remote "github"]' -l | \
	xargs dirname  | \
	while read d
		do git -C $d push -q github --mirror || echo "Mirroring $d failed"
	done