Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

crontab not running wget

Tags:

cron

wget

So I'm trying to run a wget command using crontab every 5 minutes. My problem that I have is it's just not running. I did crontab -l to see what was running, the command is there.

the command is: wget --output-document="/Users/proudowner/Desktop/tfgo/bp.json" http://backpack.tf/api/IGetMarketPrices/v1/?key=<key>

And the error log says: /bin/sh: wget: command not found

The command also runs fine without crontab.

like image 265
ariagno Avatar asked Aug 03 '15 02:08

ariagno


1 Answers

In crontab -e, make this your first line:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Then wget should work without specifying the full path.

You can also just specify the full path to wget (which wget to find it):

/usr/bin/wget --output-document="/Users/proudowner/Desktop/tfgo/bp.json" http://backpack.tf/api/IGetMarketPrices/v1/?key=55085a94ba8d88d1538b4576
like image 200
Will Avatar answered Oct 21 '22 06:10

Will