Script uitvoeren via CRON werkt niet. Via CLI wel

Pagina: 1
Acties:
  • 154 views

Vraag


Acties:
  • 0 Henk 'm!

  • Dracula
  • Registratie: Maart 2000
  • Laatst online: 10:02
Ik heb een bash script op mijn raspberry PI staan om een update te doen van Pihole adlisten.

Via CLI werkt dit script prima, echter als ik hem schedule met cron (sudo crontab -e) wordt het script niet uitgevoerd.

Script waar het om gaat:
#!/bin/bash

# exit on any error
set -e

# update pihole blocklists
sqlite3 /home/pi/pihole/gravity.db "SELECT Address FROM adlist" |sort >/home/pi/scripts/pihole.list
wget -qO - https://v.firebog.net/hosts/lists.php?type=tick |sort >/home/pi/scripts/firebog.list
comm -23 pihole.list firebog.list |xargs -I{} sudo sqlite3 /home/pi/pihole/gravity.db "DELETE FROM adlist WHERE Address='{}';"
comm -13 pihole.list firebog.list |xargs -I{} sudo sqlite3 /home/pi/pihole/gravity.db "INSERT INTO adlist (Address,Comment,Enabled) VALUES ('{}','firebog, added `date +%F`',1);"

docker exec -it pihole pihole restartdns reload
docker exec -it pihole pihole -g
Crontab regel:
0 2 * * */7 /home/pi/scripts/pihole_blocklistupdate.sh
En van de log wordt ik ook niet veel wijzer:
sudo grep CRON /var/log/syslog
Dec 1 10:33:01 pi CRON[6460]: (root) CMD (/home/pi/scripts/pihole_blocklistupdate.sh)
Dec 1 10:33:10 pi CRON[6459]: (CRON) info (No MTA installed, discarding output)

Alle reacties


Acties:
  • 0 Henk 'm!

  • Cyphax
  • Registratie: November 2000
  • Nu online

Cyphax

Moderator LNX

Saved by the buoyancy of citrus


Dit topic is gesloten.