making the script play nice with cron and ruby