Commit dbfd2ef4 authored by dimich@google.com's avatar dimich@google.com

Remove old log files so they don't accumulate on try bots.

TEST=none
BUG=none
Review URL: http://codereview.chromium.org/149263

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20057 0039d316-1c4b-4281-b951-d872f2087c98
parent a7614aa8
......@@ -25,6 +25,13 @@ THISDIR = os.path.dirname(os.path.abspath(__file__))
def PathFromBase(*pathies):
return google.path_utils.FindUpward(THISDIR, *pathies)
def RemoveLogFiles(folder, starts_with):
files = os.listdir(folder)
for file in files:
if file.startswith(starts_with) :
full_path = os.path.join(folder, file)
os.remove(full_path)
class HttpdNotStarted(Exception):
pass
......@@ -104,6 +111,10 @@ class Lighttpd:
log_file_name = "error.log-" + time_str + ".txt"
error_log = os.path.join(self._output_dir, log_file_name)
# Remove old log files. We only need to keep the last ones.
RemoveLogFiles(self._output_dir, "access.log-")
RemoveLogFiles(self._output_dir, "error.log-")
# Write out the config
f = file(base_conf_file, 'rb')
base_conf = f.read()
......
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