Mercurial > archived > louis > tools > gitgc_cron
comparison gitgc @ 0:7a19fa9c3735 default tip
- Initial import
author | Louis Opter <kalessin@kalessin.fr> |
---|---|
date | Thu, 07 Jan 2010 16:49:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7a19fa9c3735 |
---|---|
1 #!/bin/sh | |
2 | |
3 # This script assume that you have your bare repositories below this directory : | |
4 REPOS_ROOT=/var/git/ | |
5 | |
6 error() | |
7 { | |
8 echo "git-gc: error: $1." | |
9 } | |
10 | |
11 run() | |
12 { | |
13 if [ -d "$REPOS_ROOT" ] ; then | |
14 find "$REPOS_ROOT" -mindepth 1 -maxdepth 1 -type d -print0 | | |
15 xargs -0 -Ipath su www-data -c "git --git-dir='path' gc" | |
16 return 0 | |
17 fi | |
18 | |
19 error "$REPOS_ROOT doesn't exists" | |
20 return 1 | |
21 } | |
22 | |
23 run | |
24 | |
25 exit $? |