2 # Checking for inactive projects (empty repositories)
4 echo "Not ready for usage yet; have to figure out locking and check conditions --jast"
10 OUT
="$cfg_reporoot/.girocco-remove-list"
11 if [ "$1" = "-n" ]; then
19 Dear person running this, please pass 'Your Name <email@address>' as the
25 if [ -z $PRETEND ]; then
28 echo "Another cleanup process is running; aborting!"
38 for i
in $
(find -L .
-mindepth 3 -maxdepth 3 -name heads
-type d
); do
40 [ "$(ls $i)" ] && continue
41 fb
="${i##*/}"; fb
="${fb%.git}"
43 [ -d "$i/../../../$fb" ] && continue
44 [ -e "$i/../../packed-refs" ] && continue
45 # less than 60 days old?
46 [ $
(($NOW - `stat -c %Y $i/../../branches`)) -le 5184000 ] && continue
47 echo "${i%/refs/heads} $(git --git-dir="$i/..
/..
" config gitweb.owner)"
56 CURRENT
=$
(($CURRENT + 1))
57 echo -en "\rSending notification mails [$CURRENT/$TOTAL]..."
61 mail -s "[$cfg_name] Automated project removal" $y <<-EOM
64 I have removed your project '$x' from $cfg_name since you set it up
65 quite some time ago and nothing has ever been pushed in (I run this job
66 once every few months and it removes all unused projects older than two
67 months). If you want to publish anything on $cfg_name in the future,
68 feel free to create the project again. If you experienced any technical
69 difficulties with publishing on $cfg_name, please let me know,
70 hopefully we can solve them together (sometimes I don't reply for some
71 time, in that case it's best to harass me again, and repeatedly ;-). In
72 case the automated check went wrong, the repository is still backed
75 Thanks for using $cfg_name!
78 (You may also contact our support team at <$cfg_admin> which will
79 probably get you faster answers.)
86 #for i in $(find -L . -name heads -type d); do [ "$(ls $i)" ] && continue; mv ${i%/refs/heads} "$cfg_reporoot/_recyclebin/"; done
87 printf "Moving repositories to recycle bin..."
91 [ "$f" != "$x" ] || f
=""
93 mkdir
-p "$cfg_reporoot/_recyclebin/$f"
94 mv "$cfg_reporoot/$f/$x" "$cfg_reporoot/_recyclebin/$f"
98 printf "Deregistering projects..."
99 for i
in `cut -d ' ' -f 1 $OUT`; do
103 perl
-Icgi -MGirocco::Project
-e 'Girocco::Project->ghost("'$j'", 0)->_group_remove()'