Why won’t wget work with cron

bashcommand linescriptterminal

I've been using the bashpodder script recently, and while the script works beautifully when I use it in the command line, the crontab I created for it doesn't work at all. It fails when it has to use wget. I downloaded the most recent OS X binaries for wget, but the script still fails, and I get a log with an error that reads thus:

Users/username/Downloads/audio/podcasts/bashpodder.shell: line 73: wget: command not found

Lines 71-75 read like this:

if ! grep "$url" podcast.log > /dev/null
      then
         wget -t 10 -U BashPodder -c -q -O $datadir/$(echo "$url"  | awk -F'/' {'print $NF'}  |  awk -F'='         {'print $NF'} | awk -F'?' {'print $1'}) "$url"
         let "show += 1"
    fi

Any recommendations?

Best Answer

wget isn't in the default path used by cron. Give it the /full/path/to/wget and it should work.