Forums

scheduled tasks running an old script

Hi, I have created a bash script to run every hour at 15 minutes past. It just downloads an image, does some processing with imagemagick and then saves it to make available for a webpage.

I have recently updated the script to do some further image processing, however the scheduled tasks seems to be running the old version of the script. When I run the script directly from the console the correct script is run and the image is updated.

I have tried deleting all of the old tasks and creating a new one pointing to the new script, but this does not run the new script. I have even tried renaming the script and moving it to a different folder, but the old task is still run... I really don't know whats going on, other than some kind of caching in operation, but then I would have thought a new filename would have sorted that out.

Any suggestions would be helpful. Thanks

There is no caching of the scripts you used to run in scheduled tasks. The most likely thing is that you are running the correct script, but that it;s just not doing what you expect when it's run as a scheduled task.

Try outputting some marker so you can see it in the scheduled task log, then you can be sure that the script that is running is the one you expect.

OK, Thanks Glenn. Is there any difference in the environment that scheduled task are run? or is it just the same as the regular user space? Will keep digging around and try to get to the bottom of it...

Just an update. No idea what was causing this issue, have come back to this a day later and it seems to have resolved itself. It remains a mystery, but pleased it's working as expected. Thanks.

no- it should just be regular user space. another possibility is that if your script takes a long time to run, an old version of your script could still be executing even though you have deleted the task/created a new task.