3 # Script to be run from crontab on buildlogs host.
4 # Moves buildlogs around.
6 # Expected directory structure:
8 # root/$(dist)/$(arch)/
13 # Note that we look for root/*/*/.new/*.info, so don't place any additional
16 root="/home/services/ftpd/buildlogs"
17 ADDLOG="/home/services/httpd/html/pld-buildlogs/scripts/addlog.php"
19 if test -f /etc/buildlogs-mover.conf ; then
20 . /etc/buildlogs-mover.conf
23 for n in $root/*/*/.new ; do
24 if test ! -d $n ; then
25 echo "$n doesn't exists or ain't directory"
28 break # don't check all
33 info_val="$(cat "$info" 2>/dev/null)"
34 if echo "$info_val" | grep -q '^END$' ; then
35 status=$(echo "$info_val" | grep '^Status:' | sed -e 's/.*: *//')
40 # this script is run from cron, so this should go through mail
42 echo "bad buildlog status: $status in $info:" 1>&2
46 rm "$info" 2>/dev/null
50 archdir="$(dirname "$(dirname "$info")")"
51 file=$(basename "$info" .info)
52 if test -f "$archdir/.new/$file"; then
53 mv -f "$archdir/.new/$file" "$archdir/$s/$file"
54 $ADDLOG "$archdir/$s/$file"
55 rm "$info" 2>/dev/null
60 for info in $root/*/*/.new/*.info ; do
61 if test -f "$info" ; then