Added code to rupgrade that lets it run as cron