It works now Steve, I had not made it to the point of running as a cron job, but I had forgotten about Gemenviron for some unknown reason and I had a typo (an extra space) which was giving problems.