Openwrt, rdate, and cron

I’m a stickler about having the right time on all my machines. I usually use ntp but rdate is included with openwrt so that’s what I use on my router. The first thing I needed to set was the time zone. This is done via the environment variable TZ. I put the following in /etc/profile:


I like to have my time updated each day so I added the following to my crontab:

0 0 * * * /usr/sbin/rdate

Finally, I had to enable crond so I created /etc/init.d/S51crond which contains:

# start crond
/usr/sbin/crond -c /etc/spool/cron/crontabs

Having the spool directory under etc preserves changes over reboots.

This entry was posted in Geek. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s