Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
inc-meta/utilities/stats-sync.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See ukf/ukf-meta#423 for details
executable file
32 lines (23 sloc)
1.19 KB
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 | |
# This script will sync the logfiles from all of the backend servers into a central location on repo | |
# | |
# Set some common options | |
logslocation="/var/stats" | |
# Logs from API | |
# Logs from MD servers | |
rsync -at --exclude modsec* stats@md-ne-01:/var/log/httpd/* $logslocation/md/md-ne-01/ | |
rsync -at --exclude modsec* stats@md-ne-02:/var/log/httpd/* $logslocation/md/md-ne-02/ | |
rsync -at --exclude modsec* stats@md-we-01:/var/log/httpd/* $logslocation/md/md-we-01/ | |
rsync -at --exclude modsec* stats@md-we-02:/var/log/httpd/* $logslocation/md/md-we-02/ | |
# Logs from websites | |
rsync -at --exclude modsec* stats@www-ne-01:/var/log/httpd/* $logslocation/www/www-ne-01/ | |
rsync -at --exclude modsec* stats@www-we-01:/var/log/httpd/* $logslocation/www/www-we-01/ | |
# Logs from Test IdP | |
rsync -at --exclude modsec* stats@test-idp:/var/log/httpd/* $logslocation/test-idp/ | |
rsync -at stats@test-idp:/opt/shibboleth-idp/logs/idp-audit* $logslocation/test-idp/ | |
# Logs from Test SP inaccessible once the Test SP migrated to 2024 infrastructure | |
# | |
# The Test SP has a cronjob to remove logs with PII > 30 days old, we replicate that in this script | |
find $logslocation/test-sp/ -type f -mtime +90 -delete | |
# Exit happily | |
exit 0 |