seren / freenas-temperature-graphing

Scripts to graph FreeNAS CPU and drive temperatures
Other
77 stars 14 forks source link

Syntax error #5

Closed thomassandstrom closed 7 years ago

thomassandstrom commented 7 years ago

Hi! This script for FreeNAS is exactly what I'm looking for (I'm running the latest FreeNAS-9.10.2-U2) I followed the instructions from start to the end. The first time the scripts tried to run I got an error about write permissions, so I set the permissions recursively (to 777) for the dataset where the files are.

But the I got error emails with the following texts:

SUBJECT: _Cron root@freenas PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /mnt/Volym_RAIDZ_3TB/Temperature/rrd-graph.sh /mnt/Volym_RAIDZ3TB/Temperature/temps-5min.rrd > /dev/null MESSAGE: _/mnt/Volym_RAIDZ3TB/Temperature/rrd-graph.sh: 7: Syntax error: newline unexpected (expecting word)

SUBJECT: _Cron root@freenas PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /mnt/Volym_RAIDZ_3TB/Temperature/rrd.sh /mnt/Volym_RAIDZ3TB/Temperature/temps-5min.rrd > /dev/null MESSAGE: _/mnt/Volym_RAIDZ3TB/Temperature/rrd.sh: 7: Syntax error: newline unexpected (expecting word)

What can be wrong? Did I miss any step? Is there something I need to install/update?

seren commented 7 years ago

Sorry for the slow reply. Could you try adding 'set -x' as the 2nd line for rrd.sh and rrd-graph.sh, and see what happens when you manually run them with the same args (and user) as cron?

seren commented 7 years ago

I've added a bit of error-checking code. You should just be able to add '-v' after the command without having to edit the script: /mnt/Volym_RAIDZ_3TB/Temperature/rrd-graph.sh -v /mnt/Volym_RAIDZ_3TB/Temperature/temps-5min.rrd

thomassandstrom commented 7 years ago

Hi Seren, it turns out the problem was that when I downloaded the files, it grabbed it with html-code. After googling I found out how it was supposed to be done correctly.

So it was my fault after all, now it is running perfectly. Thanks for a really good script!

seren commented 7 years ago

Great, glad it's working for you. :)