Here’s a bit more explanation on how to run the temperature logging system I described earlier.
The system automatically stores the value of its sensors every five minutes using the crontab function in Linux. crontab is a schedule of recurring things to be done in the form of commands to be run on the system. There’s different crontab’s for different users. In this particular NSLU2 system I’m running crontab commands as root user. As far as I remember it was necessary to do that to have sufficient rights on the system.
To see what is in your crontab at the moment, run this command:
where -l is for list only. Use -e for editing your crontab:
This will start a default editor, in my case ‘nano’, so that you can make changes to your list.
crontab -l on this system gives this output:
# m h dom mon dow command
*/5 * * * * /home/thomas/happyfarming/update_temp_2.sh &> /dev/null
*/5 * * * * /home/thomas/happyfarming/upload_temps.sh
m: Minute. “/5” means every five minutes.
command: Command to be executed. I run the update_temp_2.sh script every five minutes. “&> /dev/null” takes the output from this command and discards it, so that I don’t get a mail every five minutes.
* means at every value, i.e. minute is 1 through 60 or hour is 1 through 24 etc.
The other command or script I run is upload_temps.sh. This will upload the graphs to this website, making them available in posts.
This is what my upload_temps.sh script looks like:
lftp -u USER,PASSWORD SERVER <<EOF
using FTP to upload the files.