Arcpy is writing all my geoprocessing history to the metadata of a file geodatabase I am trying to delete.
The script to delete the file is on another server.
However, the following code does not work:
arcpy.env.workspace = dataloc
if arcpy.GetLogHistory():
arcpy.SetLogHistory(False)
Are you trying to delete the history or just not create any new history as you run your scripts? What version of ArcGIS/ArcPy are you using?
There is a long,drawn out process described here that deletes existing geoprocessing history. I've modified the code a bit and we run it the first of every month against all of our enterprise gdb's. It also works with fgdb's.
FYI- none of the metadata related tools are available in the ArcGIS Pro environment (Yet).
In all of our scheduled task python scripts, right after we import arcpy, we use arcpy.SetLogHistory(False) so we aren't logging what we are doing.
Hi Joe.
I don't want to create any new metadata content(GP History).
I tried arcpy.SetLogHistory(False) and it doesn't work.
My script (which resides on another server) is using python 3.6 (pro 2.4)
I just checked the metadata(see italics below) and I see a new record. It's a big problem because updates occur every 30 minutes.
Greetings,
ESRI technical support logged BUG-000128506 regarding SetLogHistory function not functioning properly. I have this same issue. In my case and verified by tech support SetLogHistory is functioning as expected when the code is executed from within Pro from a python prompt. SetLogHistory is also functioning as expected if the code is tied to a toolbox tool.
It is still not working in 2.9