function mirror() {
log "Regenerating \"public\" mirror/ hardlink fun"
- date -u > ${ftpdir}/project/trace/ftp-master.debian.org
- echo "Using dak v1" >> ${ftpdir}/project/trace/ftp-master.debian.org
- echo "Running on host: $(hostname -f)" >> ${ftpdir}/project/trace/ftp-master.debian.org
+ DATE_SERIAL=$(date +"%Y%m%d01")
+ FILESOAPLUS1=$(awk '/serial/ { print $3+1 }' ${TRACEFILE} )
+ if [ "$DATE_SERIAL" -gt "$FILESOAPLUS1" ]; then
+ SERIAL="$DATE_SERIAL"
+ else
+ SERIAL="$FILESOAPLUS1"
+ fi
+ date -u > ${TRACEFILE}
+ echo "Using dak v1" >> ${TRACEFILE}
+ echo "Running on host: $(hostname -f)" >> ${TRACEFILE}
+ echo "Archive serial: ${SERIAL}" >> ${TRACEFILE}
cd ${mirrordir}
rsync -aH --link-dest ${ftpdir} --delete --delete-after --ignore-errors ${ftpdir}/. .
}