0

i have a line in crontab:

* * * * * date >> /home/pana/temperatures.txt; hddtemp /dev/sda >> /home/pana/temperatures.txt ;hddtemp /dev/sdb >> /home/pana/temperatures.txt ;sensors >> /home/pana/temperatures.txt ;printf "_________________________\n" >> /home/pana/temperatures.txt

And all i get is date, then double nothing, then sensors output and then printf. Hddtemp do not write output. That file is 777, code is inserted through sudo crontab -e. Syslog:

Jan 19 14:17:01 knedlik CRON[7099]: (CRON) info (No MTA installed, discarding output)
Jan 19 14:18:01 knedlik CRON[7108]: (root) CMD (date >> /home/pana/temperatures.txt; hddtemp /dev/sda >> /home/pana/temperatures.txt ;hddtemp /dev/sdb >> /home/pana/temperatures.txt ;sensors >> /home/pana/temperatures.txt ;printf "_________________________\n" >> /home/pana/temperatures.txt)

It is probably something dumb, but i cant see it!

  • This is a problem with the PATH, as it is detailed in the duped one. date is in PATH, hddtemp is not. – falconer Jan 19 '14 at 14:02
0

As falconer pointed - just type whereis hddtemp and add full path to script. so its look like:

* * * * * date >> /home/pana/temperatures.txt; /usr/sbin/hddtemp /dev/sda >> /home/pana/temperatures.txt ;/usr/sbin/hddtemp /dev/sdb >> /home/pana/temperatures.txt ;sensors -A >> /home/pana/temperatures.txt ;printf "_________________________\n" >> /home/pana/temperatures.txt

Not the answer you're looking for? Browse other questions tagged or ask your own question.