Skip to content

Commit

Permalink
Add find command to explicitly remove old Test SP logfiles from the s…
Browse files Browse the repository at this point in the history
…tats server

See ukf/ukf-meta#320 for details
  • Loading branch information
Alex Stuart committed Sep 8, 2021
1 parent 35aad9c commit 6f2a315
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions utilities/stats-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ rsync -at stats@test-idp:/opt/shibboleth-idp/logs/idp-audit* $logslocation/test-

# Logs from Test SP
#
# The Test SP has a cronjob to remove logs with PII > 30 days old, --delete keeps repo in sync
# The Test SP has a cronjob to remove logs with PII > 30 days old, we replicate that in this script
#
rsync --delete -at --exclude modsec* stats@test-sp:/var/log/httpd/* $logslocation/test-sp/
rsync --delete -at stats@test-sp:/var/log/shibboleth/shibd* $logslocation/test-sp/
rsync --delete -at stats@test-sp:/var/log/shibboleth/transaction* $logslocation/test-sp/
rsync -at --exclude modsec* stats@test-sp:/var/log/httpd/* $logslocation/test-sp/
rsync -at stats@test-sp:/var/log/shibboleth/shibd* $logslocation/test-sp/
rsync -at stats@test-sp:/var/log/shibboleth/transaction* $logslocation/test-sp/
find $logslocation/test-sp/ -type f -mtime +90 -delete

# Exit happily
exit 0

0 comments on commit 6f2a315

Please sign in to comment.