You may have a different LD_LIBRARY_PATH value, or some other environment variable that isn't set correctly when running the script under the scheduler. The ct_init() failure is usually caused by not finding the appropriate configuration files (locale files, for example).
Michael