rendered paste body#!/bin/shPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbinLOCK=/var/run/rsync/pcbsd.lockTIMER=/var/run/rsync/pcbsd.timerRSYNCLOG=/var/log/rsync/rsync.pcbsd.logRSYNCSRC=isc.pcbsd.org::ftpRSYNCDST=~ftp/pub/pcbsdINTERVAL=3600LASTRUN=0update() { DATESTART=`date +%s` [ -f ${TIMER} ] && read LASTRUN < ${TIMER} || LASTRUN=0 if [ ${LASTRUN} -ge 0 -a $(( ${DATESTART} - ${LASTRUN} )) -ge ${INTERVAL} ]; then rsync -vaHAXs --log-file=${RSYNCLOG} --delete-after ${RSYNCSRC} ${RSYNCDST} && date +%s > ${TIMER} fi}if [ "$1" = update ]; then shift update "$@" exitelse lockf -s -t 0 ${LOCK} sh $(realpath $0) updatefi