added example of sript for cron. fixed logging