Setup a cron job to update fulfiletimelist in alt. For now run every 6 hours, but once things settle down we can do more often.

This commit is contained in:
Kevin Fenzi 2016-05-19 19:05:16 +00:00
parent bfc89c2762
commit 7b2a5482bf
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,22 @@
#!/bin/bash
# currently runs on secondary01 from cron to update alt
MOD=$1
[ -z "$MOD" ] && {
echo "usage: $0 <module>"
exit 1
}
# This is the new list with timestamps
TMPFILE=$(mktemp -p /tmp/)
pushd /srv/pub/$MOD > /dev/null
/usr/local/bin/create-filelist . > $TMPFILE
if diff $TMPFILE fullfiletimelist > /dev/null; then
rm -f $TMPFILE
else
mv $TMPFILE fullfiletimelist
fi
chmod 0644 fullfiletimelist
popd > /dev/null

View file

@ -62,5 +62,13 @@
- name: add create-filelist script from quick-fedora-mirror
copy: src="{{ roles }}/bodhi2/backend/files/create-filelist" dest=/usr/local/bin/create-filelist mode=0755
- name: add cron script to update fullfiletimelist
copy: src="{{ files }}/scripts/update-fullfiletimelist" dest=/usr/local/bin/update-fullfiletimelist mode=0755
- name: Update fullfiletimelist job
cron: name="update-fullfiletimelist" hour="*/6" minute="55" user="root"
job="/usr/local/bin/lock-wrapper update-fullfiletimelist '/usr/local/bin/update-fullfiletimelist alt'"
cron_file=update-fullfiletimelist
handlers:
- include: "{{ handlers }}/restart_services.yml"