Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,11 @@ def analyze(args):
def cleanup(execution):
if not execution['debug']:
shutil.rmtree(execution['directory'])
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)
subprocess.run(cmd, shell=True)
def generate_execution(config, args):
execution = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment