Fixed naming and permissions so that the script can be run by CRON