defeated
13 December, 2011 - 13:25
Applogies as this is not a HAH specific question but I have spent far too long trying to get the answer to this and had no luck from other Linux forums.
All I want to do is use the cron scedhuler to write to a file located on the HAH (to reset my daily cumulative energy totals)
the command I want to use is
echo '0'>/etc/plugboard/BoilerRunTime
I have therefor added this to the Cron file as 1 0 * * * echo '0'>/etc/plugboard/BoilerRunTime
which doesnt work.
I have also tried to put this in a file and chmod a+x and then run that file but cannot get this to work either. Anyone got any bright ideas where I am going wrong. I obviously am missing some fundamental knowledge still :(
Thanks
GArry
I setup a crontab with the following and it worked perfectly.... I have no idea what you are doing wrong? At 9:11am it put a 0 into the file zero as you'd expect.
NOTE: If you have this file open in another process it might be locked for writes from other processes ie cron. Is your plugboard applet holding the file open?
If you don't want a LF to appear after the zero you can use the switch -n I'm not sure how you are reading this file and whether this would cause you a problem but I thought I'd mentioned it anyway.
Brett