shithub: gitonline

ref: 4f773ce2220a75ca15504654b3a2c5c4c906ee7d
dir: /mirror.rc/

View raw version
#!/bin/rc

webfs
cd /n/other/usr/none/repodir

repos=`{hget http://shithub.us/git/repos.html | grep '<dt><a href=' | sed 's,.*">(.*)</a></dt>,\1,g'}

for (repo in $repos) {
	date=`{date}
	if (test -d $repo) {
		echo pull $repo at $"date >> /sys/log/shithubmirror
		cd $repo
		if(git/pull) {
			cd ../../
		}
		if not {
			cd ../../
			rm -rf $repo
			echo re-clone $repo at $"date >> /sys/log/shithubmirror
			git/clone git://shithub.us/$repo $repo
		}
	}
	if not {
		echo re-clone $repo at $"date >> /sys/log/shithubmirror
		git/clone git://shithub.us/$repo $repo
	}
}
echo Mirroring done