Sync crawler logs every hour

Sync crawler logs every hour from crawlers to the frontend.
This commit is contained in:
Adrian Reber 2015-06-22 20:40:43 +00:00
parent c4500ab72d
commit dc0ba4b54f
3 changed files with 27 additions and 0 deletions

View file

@ -65,3 +65,19 @@
tags:
- mm2_frontend
- config
- name: install crawler log sync
template: src=sync-crawler-logs.sh dest=/usr/local/bin/sync-crawler-logs.sh mode=0755
- mm2_frontend
- name: create /var/log/mirrormanager/crawler
file: path=/var/log/mirrormanager/crawler state=directory owner=mirrormanager group=mirrormanager mode=0755
tags:
- mm2_frontend
- config
- name: install the cron job
template: src=frontend.cron dest=/etc/cron.d/mm2_frontend.cron
tags:
- config
- mm2_frontend

View file

@ -0,0 +1,4 @@
MAILTO=root
# sync crawler logs every hour
55 * * * * mirrormanager /usr/local/bin/sync-crawler-logs.sh

View file

@ -0,0 +1,7 @@
#!/bin/bash
CRAWLERS="{% for host in groups['mm-crawler'] %} {{ host }} {% endfor %}"
for i in ${CRAWLERS}; do
rsync -aq ${i}::crawler/ /var/log/mirrormanager/crawler/
done