hzeller / txtempus

A DCF77, WWVB, JJY and MSF clock LF-band signal transmitter using the Raspberry Pi
GNU General Public License v3.0
429 stars 67 forks source link

Crontab instruction #9

Closed larsenste closed 4 years ago

larsenste commented 4 years ago

I have successfully used the JJY60 service on pi zero to sync a citizen watch from japan which can’t receive any other service. I used the transistor circuit by Andreas Spiess with a ferrite 60hz receiver aerial as the transmitter. However, I cannot figure out how to set up Txtempus in crontab to schedule it to run. Please could somebody share the commands required to do this within crontab?

Ps thanks for sharing txtempus!

hzeller commented 4 years ago

I have these lines in my /etc/crontab

57 1    * * *   root    /usr/bin/txtempus -s DCF77 -r 10
57 2    * * *   root    /usr/bin/txtempus -s DCF77 -r 10

My watch tries synchronization at 2am and 3am (your watch might be different). So this will switch on txtempus at 1:57 and 2:57 and leave it on for 10 minutes (-r 10).

larsenste commented 4 years ago

Thanks! Works a treat, only changes I had to make was the watch sync times and filepath (as default install seems to go here not /usr/bin as above) so I’ve used the following:

57 1 * * * root /home/pi/txtempus/txtempus -s JJY60 -r 10 57 3 * * * root /home/pi/txtempus/txtempus -s JJY60 -r 10

rglory commented 4 years ago

Btw you do not have to have duplicate records, one line:

57 1,3 * * * root /home/pi/txtempus/txtempus -s JJY60 -r 10

will work exactly the same