Added 60-autodist-autobuild hourly cron script
This commit is contained in:
parent
6cf3e9f99f
commit
84d27d1f44
51
etc/cron.hourly/60-autodist-autobuild
Executable file
51
etc/cron.hourly/60-autodist-autobuild
Executable file
@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# autodist autobuild hourly cron script
|
||||
# (c) 2008-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
. /etc/autodist/config
|
||||
|
||||
ME=`basename $0`
|
||||
[ "$$" == "`pidof -x $ME`" -o "$$" == "`pidof -x 60-openmamba-autobuild-autodist`" ] || {
|
||||
echo "Warning: $ME script already running; exiting."
|
||||
exit 0
|
||||
}
|
||||
|
||||
AUTODIST_CMD="linux32 autodist"
|
||||
AUTODIST_REPOSITORY=devel-autodist
|
||||
DISTROMATIC_REPOSITORY=devel-future
|
||||
|
||||
LOGFILE=/var/autodist/log/autodist.log
|
||||
LASTLOGFILE=/var/autodist/log/autodist-last.log
|
||||
REPLOGFILE=$LOCAL_REPS_BASE_DIR/$AUTODIST_REPOSITORY/autodist.log
|
||||
REPLASTLOGFILE=$LOCAL_REPS_BASE_DIR/$AUTODIST_REPOSITORY/autodist-last.log
|
||||
|
||||
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
|
||||
distromatic -q -t $DISTROMATIC_REPOSITORY --gensrcpkglist > $LOCAL_REPS_BASE_DIR/$DISTROMATIC_REPOSITORY/srcpkglist
|
||||
|
||||
pid_check
|
||||
autodist-upstream-updates -q -h -r $DISTROMATIC_REPOSITORY -o $AUTODIST_REPOSITORY \
|
||||
> $LOCAL_REPS_BASE_DIR/distromatic/$AUTODIST_REPOSITORY/_popular.html
|
||||
|
||||
pid_check
|
||||
[ -e $LOGFILE ] && mv $LOGFILE $LASTLOGFILE
|
||||
su -l autodist -c "$AUTODIST_CMD -a --server $AUTODIST_REPOSITORY" > $LOGFILE
|
||||
[ -e $REPLOGFILE ] && mv $REPLOGFILE $REPLASTLOGFILE
|
||||
cp $LOGFILE $REPLOGFILE
|
||||
|
||||
#pid_check
|
||||
#distromatic -q -t devel-autodist --gensrcpkglist > $local_ftp/$REPOSITORY/srcpkglist
|
Loading…
Reference in New Issue
Block a user