ansible/files/scripts/update-fullfiletimelist

23 lines
429 B
Text
Raw Normal View History

#!/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
chmod 0644 fullfiletimelist
fi
popd > /dev/null