Created
November 8, 2019 17:03
-
-
Save krzysbaranski/4f97b61d4902382e164bcb17153b8403 to your computer and use it in GitHub Desktop.
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 | |
echo "rundeck logs compression and cleanup..." | |
set -exp | |
find /var/log/rundeck -name "rundeck.*.log.$(date -u +%Y-%m)-??" -exec xz -v {} \; | |
find /var/log/rundeck -name "rundeck.*.log.$(date -u -d "-1 month" +%Y-%m)-??" -exec xz -v {} \; | |
find /var/log/rundeck -name "rundeck.*.log.$(date -u -d "-2 month" +%Y-%m)-*" -exec rm -v {} \; | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment