Task Scheduler-Running python script to start a program

3019
1
07-22-2014 06:19 AM
JakeGalyon
New Contributor III

I have a model that runs perfectly fine when i run it manually.  I created a basic task and the model runs at night.  The basic task is starting up and the model starts running, the first step to delete from file gdb and append from SDE -the delete step works but not append.  The next step is feature class to feature class to export this to a shapefile, where it bombs out and the rest of the model fails to run. 

Is there an issue with permissions or perhaps something with SDE connection?  For example i am not using the O drive path (O:\GIS) i am using the \\gisvrt\GIS paths as i am aware that can cause issues.  IF the dataset in SDE is versioned would that cause an issue?  Is there a better way to approach this task?  Such as adding the model as a python script that would eliminate some of these headaches?  I appreciate any input.

Jake

0 Kudos
1 Reply
AhmadHisham
New Contributor

Maybe the scheduled job is running under another user, why don't you try to dump some info about the execution to a temp file before starting the actual work and make sure the paths actually exists, for example:

import getpass
import os.path
file = open("jobinfo.txt", "w")
file.write(" Current username:\n")
file.write(getpass.getuser())
file.write("\n Is directory existing (1=true):\n")
file.write(os.path.exists('\\gisvrt\GIS'))
file.close()

Kindly note that you may need to check this code manually before running.

You may also use the dump file technique to check if a variable is null or not and what other variables values are.

0 Kudos