Monday, June 04, 2007

Stupid Cron Tricks

This story has moved to Please read this story at its new location.


Hanno Foest said...

My solution:


while (true); do
sleep 29d
rm -f /tmp/ez-ipupdate.cache
/usr/sbin/ez-ipupdate -c /etc/ez-ipupdate.conf 2>&1 | logger -t ez-ipupdate

called from S99done with
/etc/init.d/dyndns &

Yes, ugly, but it avoids the reboot issue you mentioned.

BTW, there's no need to store the date of the last touch in any other file because there's already one: /tmp/ez-ipupdate.cache gets written with the last touch. Unfortunately, I didn't see an easy way for the "more than 29 days since writing that file" evaluation using the command line utilties OpenWRT offers. Maybe you have an idea?

Anyway, thanks for the inspiration. :)


Jean-Roch Blais said...

Thank's for this script, I'm using a Leaf Bearing-uClibc firewall and had just to simply copy your script in directory /etc/cron.daily. It works that's what counts !