Cron issue, not executing script

set these lines in a file, xecutable
executed good and working in terminal
but not as cron job

help needed
thx

rm /etc/localitems/AdvBlockHostList.txt
/usr/bin/wget -P /etc/localitems 'https://adaway.org/hosts.txt'
mv /etc/localitems/hosts.txt /etc/localitems/AdvBlockHostList.txt
cat /etc/localitems/myPrivateBlockList.txt | tee -a /etc/localitems/AdvBlockHostList.txt
/etc/init.d/dnsmasq restart

Do you have the #!/usr/bin/sh as the first line script?

What does not work about it? If it doesn't run at all, see above, also you could put something like

logger "Ad block list update running"

to generate log entries.

Instead of wget -P I'd use -O with a complete path and name to guarantee that the name of the file is as expected.

You should probably keep the list in /tmp rather than wearing out your flash. Add the script to /etc/rc.local so it reloads the list after a reboot.

4 Likes

Rather #!/bin/sh, the former would only be valid on post-usrmerge systems (OpenWrt has not done that so far).

2 Likes

Thx slh, thx Mike

your help + NTP server changed solve my issue. I think it was a time issue

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.