Cron enhancements

Hello,

I found some improvement areas while trying to get your script to work, this pull request implements some useful changes to the ruby script.

Have a nice weekend!