ariagno
ariagno

Reputation: 601

crontab not running 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.

Upvotes: 7

Views: 10697

Answers (1)

Will
Will

Reputation: 24739

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

Upvotes: 10

Related Questions