Created
November 8, 2019 17:02
-
-
Save krzysbaranski/29888dc9c5bdbea8fbf3e8546c187a5b to your computer and use it in GitHub Desktop.
rundeck delete bulk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export RD_URL='http://localhost:4440' | |
export RD_TOKEN="@option.rundeck_token@" | |
export CURRENT_DATE=$(date -u -d now "+%Y-%m-%d %H:%M:%S") | |
echo "Bulk delete of executions for frequent jobs" | |
for run in {1..5} | |
do | |
echo "deleting jobs older than 14 days - iteration ${run}" | |
rd executions deletebulk --project="RundeckProject" --status=succeeded -J --max=200 --older=14d -y || /bin/true | |
done | |
echo "########## frequent jobs cleanup ################" | |
JOB_NAME="job1" | |
echo "##### ${JOB_NAME} ######" | |
for run in {1..5} | |
do | |
echo "deleting jobs from ${JOB_NAME} iteration ${run}" | |
rd executions deletebulk --project="RundeckProject" --status=succeeded --nameexact "${JOB_NAME}" -J --max=200 --older=4d -y || /bin/true | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment