Skip to content

Commit

Permalink
Added a MAX_DELETE parameter, once this number of deleteable executio…
Browse files Browse the repository at this point in the history
…n logs have been found they are immediately deleted and the script passes on to the next job.

This was added as my aging servers seem to choke if too many logs are deleted in one go.
  • Loading branch information
unknown committed Oct 1, 2016
1 parent ad40c7f commit d588ee2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion RundeckLogfileCleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def check_deletion(execid_dates):
page = 0
deleteable = ()
more = True
while more :
while ( more and len(deleteable)< PROPERTIES['MAX_DELETE'] ) :
try:
execution_root = get_executions_for_job(jobid,page)
print " Page {0} got {1} jobs".format(page,execution_root.attrib['count'])
Expand Down
1 change: 1 addition & 0 deletions properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"MAXIMUM_DAYS": 90,
"TIMEOUT": 60,
"DELETE_TIMEOUT": 1200,
"MAX_DELETE": 2500,
"VERBOSE": false
}

0 comments on commit d588ee2

Please sign in to comment.