Sync crawler logs every hour
Sync crawler logs every hour from crawlers to the frontend.
This commit is contained in:
parent
c4500ab72d
commit
dc0ba4b54f
3 changed files with 27 additions and 0 deletions
|
@ -65,3 +65,19 @@
|
||||||
tags:
|
tags:
|
||||||
- mm2_frontend
|
- mm2_frontend
|
||||||
- config
|
- 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
|
||||||
|
|
4
roles/mirrormanager/frontend2/templates/frontend.cron
Normal file
4
roles/mirrormanager/frontend2/templates/frontend.cron
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
MAILTO=root
|
||||||
|
|
||||||
|
# sync crawler logs every hour
|
||||||
|
55 * * * * mirrormanager /usr/local/bin/sync-crawler-logs.sh
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue