I have created a model to delete a database and then copy the sde feature classes to a file geodatabse and it works sucessfully in modelbuilder when I try and schedule it as a task in Windows scheduler its running but not giving me my results, I keep getting a (0X1) expression under theLastsuccessfully tab. THX FOR YOUR HELP
Just a thought -
Make sure that you define the full external file path within your script. Something like this:
net use L: \\gisdata1\gisdata batch password /USER:WAKE\gisbatch /persistent:no
GISBATCH/batch password is a user/pass that we have set up specifically for batch jobs with a password that doesn't expire.
This mounts your external drive - Batch jobs are dumb - they don't recognize drives mounted in your logon script, for example.
You have that radio button for "Run only when user is logged on" clicked. Is your account still logged on when the script is scheduled?
or even to Lock your workstation as you. This is how I have been doing it for the last 7 years, good or bad, it works.
> The one that is not working is hosted locally but is pulling feature classes from the server. Does that have any effect????
The default security for regular Windows users in Task Scheduler is not allow access to networks or devices unless the user is logged in. You may want to look into your group policy settings and see if you can get them changed.
To follow up with what Jesus is saying, at the next release of Desktop you will have python 2.7 and python 3.4 installed, so you will need to point some scripts to 2.7 and some to 3.4 especially as some are ready to move forward and some are not, so with that said, you will reference the executable directly in the Program, and the actual path to the script in the Add Argument. So for instance if you want to do an analysis script you could reference the python 3.4 exe, with a Argument of "the path to script", while some scripts may need to do topology checks, and those will need to still be able to just run under python 2.7, with the argument of "path to script". Its probably best to practice now, since this is the way it will become in the future with the release of Pro.
Does this make sense?
OK, so you're executing a Python script...
First of all, have you tried cheking the.. "...highest privileges" check box?
As you are running a Python script I think you should introduce in this text box ("Program/script") the Python.exe executable (if you're using ArcGIS 10.1, per example, C:\Python27\ArcGIS10.1\python.exe ). In the "Add argument" I should include the complete location of the Python script and its parameters (it the script has parameters).
Once this is done, I should try to use any way for logging the script execution:
You can add in the script:
import logging, os
# this two lines will create a log file in the same location the script file is
logpath = os.path.dirname(__file__)
logging.basicConfig(filename= logpath +'\\' +'logfile.log',level=logging.DEBUG,format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
# you can add this line to your script each time you want to log that the script reaches that line:
logging.info("The script was here")
# remenber that you must mantain python indentation or tabulation.
And finally, a more complex (but better ) way, you can add a try/except block and capture the error and log it into this log file.. so you can see what is happening inside the script during its execution.
Hope this helps
Jesús
C:\DataReviewer_GUC\PythonScripts\Sewer_DatabaseTransfer.py
This is what is under the Progra/Script
To narrow down the cause of the issue, you can try modifying it to host locally and check if that works.
Check the "Run with highest privileges" check box.
And what are you including in the "Program/script" field in the "Edit/Action" text box? I don't remember if models are exposed itself as any kind of executable file or only tbx files are....
Jesús de Diego
Yeah i have other scripts working successfully however the only thing I can think about is the successfully run ones all the data is hosted locally on my C: Drive. The one that is not working is hosted locally but is pulling feature classes from the server. Does that have any effect????
Have a look at the below Blog and link and make sure you are following the steps correctly:
Scheduling a Python script or model to run at a prescribed time | ArcGIS Blog
Scheduling a Python script to run at prescribed times:
ArcGIS Help (10.2, 10.2.1, and 10.2.2)
Nothing, I did try posting the ArcMAP startup executable but without any sucess
Hi Jonah,
What program/executable are you specifying for the 'Start in' option?
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.