Hi folks,
I've set up a script** to run from cron as below. This script runs from a terminal as it should, but won't run either from cron.d or from cron.hourly when stuffed in there. Can anyone see anything glaringly obviously wrong with it?
It's run as /etc/cron.d/update-ip, with the following line: */5 * * * * root /bin/checkIP.sh
**I'm sure it's a crappy script, but as long as it does the job..... ;-)
Puzzled,
Jenny
#!/bin/sh #checks IP of courthouse every 5 mins and updates file on stoneboat /etc/ddns/courthouse-ip
set -e
currentIP=$(/usr/bin/wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]|.]//g')
remote="stoneboat:/etc/ddns/" local="/tmp/courthouse-ip"
echo $currentIP > $local >> /home/jenny/checkip.txt 2>&1 ##the last bit was put in to troubleshoot
scp $local $remote
exit 0