3 # jobd - Perform Girocco maintenance jobs
5 # jobd is Girocco repositories maintenance servant; it periodically
6 # checks all the repositories and updates mirrored repositories and
7 # repacks push-repositories when needed.
9 # Execute with parameter --all-once to run only once (on all projects)
10 # instead of in infinite loop. Or call with parameter --one and name
11 # of a project (not full path, without .git suffix) to run maintenance
12 # only on that particular project.
14 # Use -q as VERY FIRST parameter to enable quiet mode (use in cronjobs).
19 export show_progress
=1
23 if [ -e /tmp
/jobd.lock
]; then
24 echo "Locked! Stale /tmp/jobd.lock?" >&2
27 echo $$
>/tmp
/jobd.lock
28 trap "rm /tmp/jobd.lock" SIGINT SIGTERM EXIT
31 ## Single-project routine
36 if [ ! -e "$cfg_reporoot/$proj.git"/.nofetch
]; then
37 "$cfg_basedir"/jobd
/update.sh
"$proj"
39 if [ -n "$show_progress" ]; then
40 "$cfg_basedir"/jobd
/gc.sh
"$proj"
42 "$cfg_basedir"/jobd
/gc.sh
"$proj" 2>&1 |
grep -v '^Pack.*created\.$'
51 get_repo_list |
while read proj
; do
52 check_one_proj
"$proj"
59 if [ "$1" = "-q" ]; then
75 echo "Usage: $0 [-q] [--all-once | --one PRJNAME]" >&2