openmamba-headserver-tools/etc/cron.hourly/60-openmamba-autobuild-autodist

36 lines
965 B
Plaintext
Raw Permalink Normal View History

2012-03-12 15:18:41 +01:00
#!/bin/bash
#
# openmamba-dw-checklist daily cron script
# (c) 2008-2009 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
. /etc/sysconfig/openmamba-central
PIDFILE=/var/run/autodist/autodist.pid
HOUR=`date +%H`
function pid_check() {
[ -e $PIDFILE ] && PIDCHECK=`cat $PIDFILE`
[ "$PIDCHECK" -a -e /proc/$PIDCHECK ] && {
echo "Error: an autodist process is already running; exiting for safety."
exit 0
}
}
pid_check
REPOSITORY=devel-autodist
openmamba-dw-checklist -h -r $REPOSITORY > $local_ftp/distromatic/$REPOSITORY/_popular.html
pid_check
distromatic -q -t devel-autodist --gensrcpkglist > $local_ftp/$REPOSITORY/srcpkglist
pid_check
su -l autodist -c "autodist -a --server devel-autodist" > $local_ftp/$REPOSITORY/autodist.log
if [ $? -eq 0 ]; then
cp $local_ftp/$REPOSITORY/autodist.log $local_ftp/$REPOSITORY/autodist-last.log
else
cp $local_ftp/$REPOSITORY/autodist.log $local_ftp/$REPOSITORY/autodist-last-error.log
fi