SOLVED Can't run wget on crontab (dnsmasq jail)

Status
Not open for further replies.

asimov-solensan

Contributor
Joined
Oct 14, 2016
Messages
113
Hello,

I'm working with dnsmasq as a DNS server for my home network. I want to use one of those hosts files that filter mainly aggressive advertisement, shocking sites and the like.

Basically there is my server list, the hosts file downloaded, and a script that combines both and generates my hosts file.

Executing everything by hand works perfectly but got stuck in something that I'm unable to solve and seems stupidly simple at first sight. Can't downlad a file from crontab. I'm used to crontab and I have done things with it a million times before and can't know if this something related to BSD or jail or whatever, at this point I feel just stupid and need some guidance because this is driving me crazy.

This is what I'm trying. No matter how may times I try, doing this by hand just works.

Code:
*	   *	   *	   *	   *	   root	wget -N http://winhelp2002.mvps.org/hosts.txt -O /root/scripts/hosts.txt > /dev/null 2>&1


Crontab seem to run it correctly checking logs.

Code:
Jan 25 22:11:00 mascachapas /usr/sbin/cron[95625]: (root) CMD (wget -N http://winhelp2002.mvps.org/hosts.txt -O /root/scripts/hosts.txt > /dev/null 2>&1)


But the file isn't anywhere. Can anyone tell me what I'm doing wrong?
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
This is almost always a path problem. Give the full path to every command in a cron file, because the default path is almost certainly different from that of your test user. I don't have wget installed here, but probably it is at /usr/local/bin/wget. Or use the native /usr/bin/fetch.
 
Status
Not open for further replies.
Top