Maybe you will find it useful ;)
The code looks like this:
Next thing was to add one line to the end of the crontab:
Logs you will receive will be similar to those below:
To collect some statistics, I also added 'host' command... but you already saw that in the code. ;)
Also you will find some details in /var/log/fw* files generated (by cron):
Maybe you will find it useful.