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