include /globals.mak NAME=cron all: crontab install: all clean: @echo "doing $@" @rm -f crontab *.tmp *~ *.old start: crontab @if [ "${CRONUSER}" != "`whoami`" ] ; \ then \ echo "you should be ${CRONUSER} to start ${NAME}" ; \ exit 1 ; \ fi @echo "starting ${NAME}" @crontab -l > crontab.${CRONUSER}.old ; exit 0 @crontab crontab @echo "$@ done" stop: @if [ "${CRONUSER}" != "`whoami`" ] ; \ then \ echo "you should be ${CRONUSER} to stop ${NAME}" ; \ exit 1 ; \ fi @echo "stopping ${NAME}" @crontab -r @echo "$@ done" restart: stop clean start @echo "$@ done" crontab: ${CONFIGDIR}/globals.sh crontab.template @echo "making $@" @awk '{ gsub(/\"/,"\\\"",$$0);print "echo "$$0 }' ${CONFIGDIR}/globals.sh | sh > $@.tmp @crontab -l >> $@.tmp 2> /dev/null ; exit 0 @cat crontab.template >> $@.tmp @grep -v '= *$$' $@.tmp | sed 's/export //g' > $@; exit 0