Current Pi-hole version is v5.0.
Current AdminLTE version is v5.0.2.
Current FTL version is v5.0.
admin not in V5.0
Current Pi-hole version is v5.0.
Current AdminLTE version is v5.0.2.
Current FTL version is v5.0.
admin not in V5.0
Because the regex you used is not valid/working to block everything.
when I manually launch the shell in the internet terminal is well cut
when I activate the group via the ihm then the internet is cut off.
when the script is executed via crontab then the internet is not cut, while in the GUI of he group option indicates active.
ditto in the database the value is indeed 1
if you have better regular expression i'm ok
1 means enabled, is that what you have your scripts set to do?
What is the output from sudo crontab -l
please? (Or the output from the crontab of the user you're running the cron job with.)
I deleted what was in the root crontab because I only had 2 lines which were for speedtest so I killed them 15min ago
and I redid tests without success
Please read over Debugging cron jobs
Make sure your cron job is configured correctly and not producing any errors or log files.
$ crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
# --------------------------- Basmala ---------------------------------
#Connexion école
0 8 * * 1-5 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='basmala_internet';" ; sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='basmala_cours';" ; pihole restartdns reload-lists
0 9 * * 0,6 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='basmala_internet';" ; sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='basmala_cours';" ; pihole restartdns reload-lists
#déconnexion école
0 13 * * 1-5 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='basmala_internet';" ; sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='basmala_cours';" ; pihole restartdns reload-lists
0 11 * * 0,6 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='basmala_internet';" ; sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='basmala_cours';" ; pihole restartdns reload-lists
#connexion soir
30 18 * * 1-5 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='basmala_internet';" ; pihole restartdns reload-lists
0 18 * * 0,6 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='basmala_internet';" ; pihole restartdns reload-lists
#déconnexion le soir
30 20 * * 0-4 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='basmala_internet';" ; pihole restartdns reload-lists
0 1 * * 0,6 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='basmala_internet';" ; pihole restartdns reload-lists
# ---------------------------- Malek -------------------------------------
#Connexion école
0 9 * * 1-5 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='malek_internet';" ; sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='malek_cours';" ; pihole restartdns reload-lists
#déconnexion école
0 18 * * 1 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='malek_internet';" ; sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='malek_cours';" ; pihole restartdns reload-lists
0 17 * * 2 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='malek_internet';" ; sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='malek_cours';" ; pihole restartdns reload-lists
0 15 * * 3-5 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='malek_internet';" ; sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='malek_cours';" ; pihole restartdns reload-lists
#connexion soir
30 19 * * 1-5 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='malek_internet';" ; pihole restartdns reload-lists
0 18 * * 0,6 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='malek_internet';" ; pihole restartdns reload-lists
#déconnexion le soir
30 21 * * 0-4 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='malek_internet';" ; pihole restartdns reload-lists
2 1 * * 0,6 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='malek_internet';" ; pihole restartdns reload-lists
25 0 * * 1-5 sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='malek_internet';" ; pihole restartdns reload-lists
actually if I reissue this command in my shell
it works.
pihole restartdns reload-lists
but not in the cron
i tried adding >/dev/null
but ditto
this command does not generate a log is this normal?
pihole restartdns reload-lists
how can i track the execution of this command
i find a solution
crontab couldn't find the command pihole
simply add
usr / local / bin /
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.