Commit d2304840 authored by Marc's avatar Marc
Browse files

psot deletes all lines except the last ten lines in database_paths.log, if logfile is too big (1MB)

parent 09587489
......@@ -66,6 +66,11 @@ def analyze(args):
def cleanup(execution):
if not execution['debug']:
logfile = execution['install_path'] + '/database_paths.log'
if os.stat(logfile).st_size >= 131072:
cmd = "tmpfile=$(mktemp); tail {logfile} > $tmpfile; cat $tmpfile > {logfile}; rm -f $tmpfile;".format(logfile=logfile), shell=True)
def generate_execution(config, args):
execution = {}
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