From 84da00f62de81ef28dd39265a1210cba35674771 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 6 Feb 2015 01:42:12 +0100 Subject: [PATCH 1/3] increase version number for develop branch --- src/buildno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buildno.h b/src/buildno.h index 008d66547..0f6b1dc97 100644 --- a/src/buildno.h +++ b/src/buildno.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 3 -#define VERSION_MINOR 4 +#define VERSION_MINOR 5 #define VERSION_BUILD 698 From 741cb30e90eaf8ee6f77a8e5bdbdbc847889a1ae Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 7 Feb 2015 19:04:50 +0100 Subject: [PATCH 2/3] clean up cron jobs, add crontab, add flag to disable jobs --- .../{backup-eressea => backup-eressea.cron} | 0 .../cron/{create-orders => create-orders.cron} | 0 process/cron/crontab | 17 +++++++++++++++++ process/cron/orders.cron | 16 ++++++++++++++++ s/cron/previews.sh => process/cron/preview.cron | 10 +++++----- process/cron/{run-eressea => run-eressea.cron} | 0 process/cron/{run-turn => run-turn.cron} | 0 s/install | 5 +++++ 8 files changed, 43 insertions(+), 5 deletions(-) rename process/cron/{backup-eressea => backup-eressea.cron} (100%) rename process/cron/{create-orders => create-orders.cron} (100%) create mode 100644 process/cron/crontab create mode 100755 process/cron/orders.cron rename s/cron/previews.sh => process/cron/preview.cron (53%) rename process/cron/{run-eressea => run-eressea.cron} (100%) rename process/cron/{run-turn => run-turn.cron} (100%) diff --git a/process/cron/backup-eressea b/process/cron/backup-eressea.cron similarity index 100% rename from process/cron/backup-eressea rename to process/cron/backup-eressea.cron diff --git a/process/cron/create-orders b/process/cron/create-orders.cron similarity index 100% rename from process/cron/create-orders rename to process/cron/create-orders.cron diff --git a/process/cron/crontab b/process/cron/crontab new file mode 100644 index 000000000..9e37aec59 --- /dev/null +++ b/process/cron/crontab @@ -0,0 +1,17 @@ +# Crontab for Eressea on gruenbaer.kn-bremen.de + +PATH=$HOME/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin +ERESSEA=/home/eressea/eressea +ATLANTIS=/home/eressea/atlantis +ENABLED=no +CONFIRM=yes + +# m h dom mon dow command +00 00 * * * $HOME/bin/fetchmail.cron +00 22 * * * $HOME/bin/backup-db.sh + +*/2 * * * * [ "$CONFIRM" = "yes" ] || $ERESSEA/eressea/server/bin/orders.cron 2 3 4 +15 21 * * Sat [ "$ENABLED" = "yes" ] || $ERESSEA/server/bin/run-eressea.cron 3 +25 21 * * Sat [ "$ENABLED" = "yes" ] || $ERESSEA/server/bin/run-eressea.cron 4 +35 21 * * Sat [ "$ENABLED" = "yes" ] || $ERESSEA/server/bin/run-eressea.cron 2 +39 08 * * Sun [ "$ENABLED" = "yes" ] || $ERESSEA/server/bin/previews.cron diff --git a/process/cron/orders.cron b/process/cron/orders.cron new file mode 100755 index 000000000..be573fe86 --- /dev/null +++ b/process/cron/orders.cron @@ -0,0 +1,16 @@ +#!/bin/bash + +## this script processes incoming order files. +# files are delivered into an incoming queue by procmail, then cron runs +# this here script to make a non-blocking syntax check and reject or +# accept the order file. + +for GAME in $* +do + if [ "$GAME" == "eressea" ]; then GAME=2 ; fi + if [ "$GAME" == "e3a" ]; then GAME=3 ; fi + if [ -e $HOME/eressea/game-$GAME/orders.queue ] + then + $HOME/bin/orders-process $GAME + fi +done diff --git a/s/cron/previews.sh b/process/cron/preview.cron similarity index 53% rename from s/cron/previews.sh rename to process/cron/preview.cron index 37147ac53..fe2c49ba1 100755 --- a/s/cron/previews.sh +++ b/process/cron/preview.cron @@ -5,10 +5,10 @@ branch="master" if [ -e ${ERESSEA}/build/.preview ]; then branch=`cat ${ERESSEA}/build/.preview` fi -SRC=${ERESSEA}/git -${SRC}/s/preview build ${branch} || exit $? -${SRC}/s/preview version +BIN=${ERESSEA}/server/s +${BIN}/preview build ${branch} || exit $? +${BIN}/preview version for game in 2 3 4 ; do - ${SRC}/s/preview -g ${game} run && \ - ${SRC}/s/preview -g ${game} send + ${BIN}/preview -g ${game} run && \ + ${BIN}/preview -g ${game} send done diff --git a/process/cron/run-eressea b/process/cron/run-eressea.cron similarity index 100% rename from process/cron/run-eressea rename to process/cron/run-eressea.cron diff --git a/process/cron/run-turn b/process/cron/run-turn.cron similarity index 100% rename from process/cron/run-turn rename to process/cron/run-turn.cron diff --git a/s/install b/s/install index 08d171849..fe1f6196c 100755 --- a/s/install +++ b/s/install @@ -8,6 +8,8 @@ while [ ! -d $ROOT/.git ]; do fi done +DEST=$(dirname $ROOT)/server + MACHINE=`uname -m` [ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" [ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" @@ -17,3 +19,6 @@ BIN_DIR="build-$MACHINE-$CC-Debug" cd $ROOT/$BIN_DIR make install +[ -d $DEST/bin ] || mkdir -p $DEST/bin +install -v $ROOT/process/cron/*.cron $DEST/bin/ +crontab $ROOT/process/cron/crontab From 742f464ee568a1c091d281cb4b25c8d0f4f4a86b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 8 Feb 2015 10:35:59 +0100 Subject: [PATCH 3/3] further fixes to the crontab system --- process/{cron/backup-eressea.cron => backup-eressea} | 0 process/{cron/create-orders.cron => create-orders} | 0 process/cron/crontab | 5 +++-- process/cron/run-eressea.cron | 4 ++-- process/{cron/run-turn.cron => run-turn} | 0 s/install | 4 ++++ 6 files changed, 9 insertions(+), 4 deletions(-) rename process/{cron/backup-eressea.cron => backup-eressea} (100%) rename process/{cron/create-orders.cron => create-orders} (100%) rename process/{cron/run-turn.cron => run-turn} (100%) diff --git a/process/cron/backup-eressea.cron b/process/backup-eressea similarity index 100% rename from process/cron/backup-eressea.cron rename to process/backup-eressea diff --git a/process/cron/create-orders.cron b/process/create-orders similarity index 100% rename from process/cron/create-orders.cron rename to process/create-orders diff --git a/process/cron/crontab b/process/cron/crontab index 9e37aec59..bcdc326c9 100644 --- a/process/cron/crontab +++ b/process/cron/crontab @@ -4,14 +4,15 @@ PATH=$HOME/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin ERESSEA=/home/eressea/eressea ATLANTIS=/home/eressea/atlantis ENABLED=no +PREVIEW=no CONFIRM=yes # m h dom mon dow command 00 00 * * * $HOME/bin/fetchmail.cron 00 22 * * * $HOME/bin/backup-db.sh -*/2 * * * * [ "$CONFIRM" = "yes" ] || $ERESSEA/eressea/server/bin/orders.cron 2 3 4 15 21 * * Sat [ "$ENABLED" = "yes" ] || $ERESSEA/server/bin/run-eressea.cron 3 25 21 * * Sat [ "$ENABLED" = "yes" ] || $ERESSEA/server/bin/run-eressea.cron 4 35 21 * * Sat [ "$ENABLED" = "yes" ] || $ERESSEA/server/bin/run-eressea.cron 2 -39 08 * * Sun [ "$ENABLED" = "yes" ] || $ERESSEA/server/bin/previews.cron +39 08 * * Sun [ "$PREVIEW" = "yes" ] || $ERESSEA/server/bin/previews.cron +*/5 * * * * [ "$CONFIRM" = "yes" ] || $ERESSEA/server/bin/orders.cron 2 3 4 diff --git a/process/cron/run-eressea.cron b/process/cron/run-eressea.cron index e932378fc..becf5b860 100755 --- a/process/cron/run-eressea.cron +++ b/process/cron/run-eressea.cron @@ -39,7 +39,7 @@ if [ ! -s $ERESSEA/game-$GAME/data/$TURN.dat ]; then fi echo "sending reports for game $GAME, turn $TURN" $BIN/compress.sh $GAME $TURN -$BIN/sendreports.sh $GAME +# $BIN/sendreports.sh $GAME +# [ $GAME -lt 4 ] && $BIN/send-summary $GAME $BIN/backup-eressea $GAME $TURN -[ $GAME -lt 4 ] && $BIN/send-summary $GAME rm -f test/execute.lock diff --git a/process/cron/run-turn.cron b/process/run-turn similarity index 100% rename from process/cron/run-turn.cron rename to process/run-turn diff --git a/s/install b/s/install index fe1f6196c..39c91174a 100755 --- a/s/install +++ b/s/install @@ -21,4 +21,8 @@ make install [ -d $DEST/bin ] || mkdir -p $DEST/bin install -v $ROOT/process/cron/*.cron $DEST/bin/ +programs="create-orders backup-eressea run-turn" +for prg in ${programs} ; do +install -v $ROOT/process/$prg $DEST/bin/ +done crontab $ROOT/process/cron/crontab