# Adblock - Weekdays only

**URL:** <https://forum.openwrt.org/t/adblock-weekdays-only/22334>\
**Category:** Installing and Using OpenWrt\
**Created:** [September 30, 2018, 7:49pm UTC](https://forum.openwrt.org/t/adblock-weekdays-only/22334 "2018-09-30T19:49:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tam481](https://forum.openwrt.org/user_avatar/forum.openwrt.org/tam481/32/1617_2.png) [@tam481](https://forum.openwrt.org/u/tam481)\
**Post date:** [September 30, 2018, 7:49pm UTC](https://forum.openwrt.org/t/adblock-weekdays-only/22334/1 "2018-09-30T19:49:10Z")

</div>

Hello,  
Is there a way to control the timing so that Adblock is enabled during the weekdays only (In a similar way to how firewall rules work)? I use it to block gaming websites but I want it to do so during workdays only.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![dibdot](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dibdot/32/3100_2.png) [@dibdot](https://forum.openwrt.org/u/dibdot)\
**Post date:** [September 30, 2018, 8:59pm UTC](https://forum.openwrt.org/t/adblock-weekdays-only/22334/2 "2018-09-30T20:59:18Z")

</div>

just add two cron entries, e.g.

```
# suspend adblock friday night at 00:00
0 0 * * 5 /etc/init.d/adblock suspend

# resume adblock sunday night at 00:00
0 0 * * 0 /etc/init.d/adblock resume

```

---

<div class="post-metadata">

**Author:** ![tam481](https://forum.openwrt.org/user_avatar/forum.openwrt.org/tam481/32/1617_2.png) [@tam481](https://forum.openwrt.org/u/tam481)\
**Post date:** [October 1, 2018, 6:12pm UTC](https://forum.openwrt.org/t/adblock-weekdays-only/22334/3 "2018-10-01T18:12:11Z")

</div>

Thank you @dibdot. You're a star.

Shouldn't it be like this:

#suspend adblock Saturday night at 00:00  
0 0 \* \* 6 /etc/init.d/adblock suspend

#resume adblock Monday night at 00:00  
0 0 \* \* 1 /etc/init.d/adblock resume

The idea would be to suspend at the start of Saturday and finish at the end of Sunday which would be the start of Monday? I don't know much about Crontab so I could be wrong but I read your script as starting Friday and ending at the start of Sunday.

---

<div class="post-metadata">

**Author:** ![lleachii](https://forum.openwrt.org/letter_avatar/lleachii/32/5_5575768a8748004e209b776fc1b2916d.png) [@lleachii](https://forum.openwrt.org/u/lleachii)\
**Post date:** [October 1, 2018, 7:30pm UTC](https://forum.openwrt.org/t/adblock-weekdays-only/22334/4 "2018-10-01T19:30:20Z")

</div>

Also, if you want Ad block to update, you have to add a **reload** command job as well.

---

<div class="post-metadata">

**Author:** ![tam481](https://forum.openwrt.org/user_avatar/forum.openwrt.org/tam481/32/1617_2.png) [@tam481](https://forum.openwrt.org/u/tam481)\
**Post date:** [October 1, 2018, 8:57pm UTC](https://forum.openwrt.org/t/adblock-weekdays-only/22334/5 "2018-10-01T20:57:01Z")

</div>

Thank you @lleachii

Does this look right to you guys?

##suspend adblock Saturday at 00:00  
0 0 \* \* 6 /etc/init.d/adblock suspend

##resume adblock Monday at 00:00  
0 0 \* \* 1 /etc/init.d/adblock resume && /etc/init.d/adblock reload

---

<div class="post-metadata">

**Author:** ![lleachii](https://forum.openwrt.org/letter_avatar/lleachii/32/5_5575768a8748004e209b776fc1b2916d.png) [@lleachii](https://forum.openwrt.org/u/lleachii)\
**Post date:** [October 1, 2018, 8:59pm UTC](https://forum.openwrt.org/t/adblock-weekdays-only/22334/6 "2018-10-01T20:59:25Z")

</div>

Yes, that should update your Adblock once per week.

---

<div class="post-metadata">

**Author:** ![dibdot](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dibdot/32/3100_2.png) [@dibdot](https://forum.openwrt.org/u/dibdot)\
**Post date:** [October 2, 2018, 7:39am UTC](https://forum.openwrt.org/t/adblock-weekdays-only/22334/7 "2018-10-02T07:39:31Z")

</div>

> [@tam481](#):
>
> Does this look right to you guys?

Regarding your restart action on Monday it's sufficient to reload adblock, there is no need to explicitly resume beforehand.
