How to run a script on a rooted android device?
You Can Download BusyBox which has many common UNIX utilities. You can write a script in shell and can run it on Teriminal Emulator
If you know python you can write and run script on Qpython3
You can use Tasker to schedule script.
You can download Dolphin Browser and can relode tab with Dolphin Tab Relode


{ have no idea about creating Log :( 
And I know it is not proper solution but you can try to get solution using above mentioned apps.}