forked from github/server
cron fixes
This commit is contained in:
parent
de9fec8eed
commit
7e6312441c
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from sys import argv, exit
|
from sys import argv, exit
|
||||||
from string import join
|
from string import join
|
||||||
from os import access, R_OK
|
import os
|
||||||
from os import system, symlink
|
import os.path
|
||||||
|
|
||||||
gamename='Eressea'
|
gamename='Eressea'
|
||||||
|
|
||||||
|
@ -43,15 +43,13 @@ for line in infile.readlines():
|
||||||
if options["compression"]=="zip":
|
if options["compression"]=="zip":
|
||||||
output = prefix+"zip"
|
output = prefix+"zip"
|
||||||
files = [output]
|
files = [output]
|
||||||
if (access(output, R_OK)):
|
if not os.path.isfile(output):
|
||||||
pass
|
|
||||||
else:
|
|
||||||
parameters = []
|
parameters = []
|
||||||
for extension in reports:
|
for extension in reports:
|
||||||
filename = "%s%s" % (prefix, extension)
|
filename = "%s%s" % (prefix, extension)
|
||||||
if (access(filename, R_OK)):
|
if os.path.isfile(filename):
|
||||||
parameters = parameters + [ filename ]
|
parameters = parameters + [ filename ]
|
||||||
system("zip %s -q -m -j %s" % (output, join(parameters," ")))
|
os.system("zip %s -q -m -j %s" % (output, join(parameters," ")))
|
||||||
else:
|
else:
|
||||||
files = []
|
files = []
|
||||||
for extension in reports:
|
for extension in reports:
|
||||||
|
@ -59,15 +57,13 @@ for line in infile.readlines():
|
||||||
filename = "%s%s" % (prefix, extension)
|
filename = "%s%s" % (prefix, extension)
|
||||||
output = "%s%s.bz2" % (prefix, extension)
|
output = "%s%s.bz2" % (prefix, extension)
|
||||||
files = files+[output]
|
files = files+[output]
|
||||||
if access(filename, R_OK):
|
if os.path.isfile(filename):
|
||||||
if access(output, R_OK):
|
if os.path.isfile(output):
|
||||||
continue
|
continue
|
||||||
system("bzip2 %s" % filename)
|
os.system("bzip2 %s" % filename)
|
||||||
if not access('../wochenbericht.txt', R_OK):
|
|
||||||
os.symlink('../parteien', '../wochenbericht.txt')
|
|
||||||
extras = [ '../wochenbericht.txt', '../express.txt' ]
|
extras = [ '../wochenbericht.txt', '../express.txt' ]
|
||||||
for extra in extras:
|
for extra in extras:
|
||||||
if access(extra, R_OK):
|
if os.path.isfile(extra):
|
||||||
files = files + [extra]
|
files = files + [extra]
|
||||||
options["files"] = join(files, " ")
|
options["files"] = join(files, " ")
|
||||||
batch = file("%s.sh" % options["faction"], "w")
|
batch = file("%s.sh" % options["faction"], "w")
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
PATH=/home/eressea/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin
|
PATH=/home/eressea/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
ERESSEA=/home/eressea/eressea
|
ERESSEA=/home/eressea/eressea
|
||||||
ATLANTIS=/home/eressea/atlantis
|
|
||||||
ENABLED=yes
|
ENABLED=yes
|
||||||
PREVIEW=yes
|
PREVIEW=yes
|
||||||
CONFIRM=yes
|
CONFIRM=yes
|
||||||
|
|
|
@ -40,6 +40,5 @@ fi
|
||||||
echo "sending reports for game $GAME, turn $TURN"
|
echo "sending reports for game $GAME, turn $TURN"
|
||||||
$BIN/compress.sh $GAME $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
|
$BIN/backup-eressea $GAME $TURN
|
||||||
rm -f test/execute.lock
|
rm -f test/execute.lock
|
||||||
|
|
|
@ -27,5 +27,6 @@ install -v $ROOT/process/$prg $DEST/bin/
|
||||||
done
|
done
|
||||||
|
|
||||||
# install crontab, but only on the eressea server:
|
# install crontab, but only on the eressea server:
|
||||||
WHOAMI=`whoami`@`hostname`
|
# in fact, never do this, because it overwrites hand-edits
|
||||||
[ "eressea@gruenbaer" = "$WHOAMI" ] && crontab $ROOT/process/cron/crontab
|
#WHOAMI=`whoami`@`hostname`
|
||||||
|
#[ "eressea@gruenbaer" = "$WHOAMI" ] && crontab $ROOT/process/cron/crontab
|
||||||
|
|
Loading…
Reference in New Issue