Commit a1aae5c2 authored by Marc's avatar Marc
Browse files

extended error handling in download_databases_from_s3bucket.sh and cleanup of...

extended error handling in download_databases_from_s3bucket.sh and cleanup of logfile in main.py happens now if logfile is 1KB
parent d2304840
......@@ -52,7 +52,9 @@ function all_folders_in_datadir () {
}
function sync_data () {
[[ -r $DATADIR && -w $DATADIR && -x $DATADIR ]] || fail "ERROR: database directory must be readable, writable and executable"
echo "Downloading databases... "
cd $DATADIR
......@@ -82,7 +84,7 @@ function fail () {
exit 1
}
[ "$#" -eq 2 ] || fail "2 arguments required, $# provided"
[ "$#" -eq 2 ] || fail "ERROR: 2 arguments required, $# provided"
if [[ -e $LOGFILE ]]; then
test_datadir
......
......@@ -68,7 +68,7 @@ def cleanup(execution):
shutil.rmtree(execution['directory'])
logfile = execution['install_path'] + '/database_paths.log'
if os.stat(logfile).st_size >= 131072:
if os.stat(logfile).st_size >= 1024:
cmd = "tmpfile=$(mktemp); tail {logfile} > $tmpfile; cat $tmpfile > {logfile}; rm -f $tmpfile;".format(logfile=logfile)
subprocess.run(cmd, shell=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment