How do I disable mobile data access for certain apps at certain intervals? Due to increased battery drain I figured I should probably come up with a solution that will allow me to block access for certain apps during certain hours while the only data connectivity available is the mobile connection.

For example: I don't really care if someone is messaging me via LinkedIn during night time so it's probably better not to check.
Or if I'm not over obsessed with who is messaging me via OkCupid I would probably want to increase the check interval for that app to check for new data only once an hour or 3 hours.
Blocking Facebook push notifications during work hours is pretty much reasonable as another example.

I've been looking at solutions such as AWall+ and although I could figure how to block data I could find any simple method of defining time range for that operation.

I was also thinking of a possibility to block access for half an hour after a fetch, this way the interval will change to a half an hour minimum causing the battery to drain less.

Do you guys know of any existing app or Tasker script? (My phone is rooted)
Thanks in advance!
AFWall+ allows creation of multiple profiles and the profiles can be toggled using Tasker. I'm giving you a basic idea now. 


Enable multi-profile support in AFWall+. It's inside the Preferences.
For nighttime, create a profile and allow or disallow the apps which you want/don't want to connect to Internet or to a particular network interface.

(Click image to enlarge)


Once done, create a task in Tasker with the action Plugin &rarr; AFWall+ &rarr; Configuration &rarr; choose your profile.


Now it is up to you how you want this task to be executed. The best option is to create a time triggered profile and assign the task to it. This technique would work for office hours as well. 


  I was also thinking of a possibility to block access for half an hour after a fetch...


This can be done too, now that you've got the idea about AFWall+ profiles. 

Consider this example: If it is about two profiles to be switched after an interval, I would roughly use these actions in a task:


Select an AFWall+ profile of your choice under Plugins
Task &rarr; Wait and make it 30 minutes
Select another AFWall+ profile to be triggered
Add Wait of another 30 minutes
Task &rarr; Goto &rarr; and choose first action.


You just created an  endless task. Attach it to a time triggered profile or any profile of your choice. 

In order to stop that infinitely looping task, create another task and use the action Task &rarr; Stop &rarr; choose the task to be stopped. You've to execute this task of course.