From b80e127aed63a345856796b72bf1b86a78ee0db9 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Wed, 11 Jun 2014 16:12:10 +0000 Subject: let us try another fix for the download-ib box --- files/download/cron-daily-sync.sh | 27 --------------------------- files/download/download-sync.cron | 3 +++ files/download/sync-up-downloads.sh | 27 +++++++++++++++++++++++++++ files/rdiff-backup/#run-rdiff-backups.cron# | 3 +++ playbooks/groups/download.yml | 7 +++++-- 5 files changed, 38 insertions(+), 29 deletions(-) delete mode 100755 files/download/cron-daily-sync.sh create mode 100644 files/download/download-sync.cron create mode 100755 files/download/sync-up-downloads.sh create mode 100644 files/rdiff-backup/#run-rdiff-backups.cron# diff --git a/files/download/cron-daily-sync.sh b/files/download/cron-daily-sync.sh deleted file mode 100755 index 22128cc3b..000000000 --- a/files/download/cron-daily-sync.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -## -## This script is used to sync data from main download servers to -## secondary server at ibiblio. -## - -RSYNC='/usr/bin/rsync' -RS_OPT="-avSHP --numeric-ids" -RS_DEADLY="--delete --delete-excluded --delete-delay --delay-updates" -ALT_EXCLUDES="--exclude deltaisos/archive" -EPL_EXCLUDES="" -FED_EXCLUDES="" - -SERVER=dl.fedoraproject.org - -# http://dl.fedoraproject.org/pub/alt/stage/ -${RSYNC} ${RS_OPT} ${RS_DEADLY} ${ALT_EXCLUDES} ${SERVER}::fedora-alt/stage/ /srv/pub/alt/stage/ | tail -n2 | logger -p local0.notice -t rsync_updates_alt_stg -# http://dl.fedoraproject.org/pub/alt/bfo/ -${RSYNC} ${RS_OPT} ${RS_DEADLY} ${ALT_EXCLUDES} ${SERVER}::fedora-alt/bfo/ /srv/pub/alt/bfo/ | tail -n2 | logger -p local0.notice -t rsync_updates_alt_bfo -# http://dl.fedoraproject.org/pub/epel/ -${RSYNC} ${RS_OPT} ${RS_DEADLY} ${EPL_EXCLUDES} ${SERVER}::fedora-epel/ /srv/pub/epel/ | tail -n2 | logger -p local0.notice -t rsync_updates_epel -# http://dl.fedoraproject.org/pub/fedora/ -${RSYNC} ${RS_OPT} ${RS_DEADLY} ${FED_EXCLUDES} ${SERVER}::fedora-enchilada0/ /srv/pub/fedora/ | tail -n2 | logger -p local0.notice -t rsync_updates_fedora - -# Let MM know I'm all up to date -#/usr/bin/report_mirror diff --git a/files/download/download-sync.cron b/files/download/download-sync.cron new file mode 100644 index 000000000..d01dc5620 --- /dev/null +++ b/files/download/download-sync.cron @@ -0,0 +1,3 @@ +# run twice daily rsync of download. but lock it +MAILTO=smooge@gmail.com +00 11,23 * * * root /usr/local/bin/lock-wrapper sync-up-downloads "/usr/local/bin/sync-up-downloads" diff --git a/files/download/sync-up-downloads.sh b/files/download/sync-up-downloads.sh new file mode 100755 index 000000000..22128cc3b --- /dev/null +++ b/files/download/sync-up-downloads.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +## +## This script is used to sync data from main download servers to +## secondary server at ibiblio. +## + +RSYNC='/usr/bin/rsync' +RS_OPT="-avSHP --numeric-ids" +RS_DEADLY="--delete --delete-excluded --delete-delay --delay-updates" +ALT_EXCLUDES="--exclude deltaisos/archive" +EPL_EXCLUDES="" +FED_EXCLUDES="" + +SERVER=dl.fedoraproject.org + +# http://dl.fedoraproject.org/pub/alt/stage/ +${RSYNC} ${RS_OPT} ${RS_DEADLY} ${ALT_EXCLUDES} ${SERVER}::fedora-alt/stage/ /srv/pub/alt/stage/ | tail -n2 | logger -p local0.notice -t rsync_updates_alt_stg +# http://dl.fedoraproject.org/pub/alt/bfo/ +${RSYNC} ${RS_OPT} ${RS_DEADLY} ${ALT_EXCLUDES} ${SERVER}::fedora-alt/bfo/ /srv/pub/alt/bfo/ | tail -n2 | logger -p local0.notice -t rsync_updates_alt_bfo +# http://dl.fedoraproject.org/pub/epel/ +${RSYNC} ${RS_OPT} ${RS_DEADLY} ${EPL_EXCLUDES} ${SERVER}::fedora-epel/ /srv/pub/epel/ | tail -n2 | logger -p local0.notice -t rsync_updates_epel +# http://dl.fedoraproject.org/pub/fedora/ +${RSYNC} ${RS_OPT} ${RS_DEADLY} ${FED_EXCLUDES} ${SERVER}::fedora-enchilada0/ /srv/pub/fedora/ | tail -n2 | logger -p local0.notice -t rsync_updates_fedora + +# Let MM know I'm all up to date +#/usr/bin/report_mirror diff --git a/files/rdiff-backup/#run-rdiff-backups.cron# b/files/rdiff-backup/#run-rdiff-backups.cron# new file mode 100644 index 000000000..e1045d232 --- /dev/null +++ b/files/rdiff-backup/#run-rdiff-backups.cron# @@ -0,0 +1,3 @@ +# run rdiff backups +MAILTO=kevin@scrye.com,smooge@gmail.com +00 22 * * * root /usr/local/bin/lock-wrapper run-rdiff-backups "/usr/local/bin/run-rdiff-backups" diff --git a/playbooks/groups/download.yml b/playbooks/groups/download.yml index a400a9f57..9297e73a2 100644 --- a/playbooks/groups/download.yml +++ b/playbooks/groups/download.yml @@ -69,8 +69,11 @@ - include: "{{ tasks }}/apache.yml" - include: "{{ tasks }}/openvpn_client.yml" when: datacenter != 'phx2' - - name: put in hourly cron job for syncing - action: copy src="{{ files }}/download/cron-daily-sync.sh" dest=/etc/cron.daily/sync-mirror.sh owner=root group=root mode=755 + - name: put in script for syncing + action: copy src="{{ files }}/download/sync-up-downloads.sh" dest=/usr/local/bin/sync-up-downloads owner=root group=root mode=755 + when: datacenter == 'ibiblio' + - name: put in cron job for syncing + action: copy src="{{ files }}/download/download-sync.cron" dest=/etc/cron.d/download-sync owner=root group=root mode=644 when: datacenter == 'ibiblio' handlers: -- cgit