AnsweredAssumed Answered

Basemap python script log

Question asked by ramjee on Sep 10, 2018
Latest reply on Sep 10, 2018 by JQuinn-esristaff

I have created a script that recreate tiles in 2 steps.
1 delete tiles
2 create tiles

My script logs are not accurate. It gives me same date time stamp. Is there a way to fix

Additionally is it possible to recreate those tiles where data is updated

I have included my script which is rather simple.



# Import arcpy module
import arcpy

# Open a log file to write to
f = open(r'C:\Temp\logs\BaseMap_Update.txt','w')

# Write date/time
f.write("BaseMap Delete Tiles start:")
f.write(time.strftime('%x %X'))

# AGS DEV Server
CITY_BNDRY = "Database Connections\\MyCN.sde\\Boundary"
Test1 = "C:\\MyPath\\ESRI\\Desktop10.3\\ArcCatalog\\arcgis\\BaseMaps\\BaseMap_UPDATE.MapServer"

arcpy.ManageMapServerCacheTiles_server(Test1, "4622324.434309;2311162.217155;1155581.108577;577790.554289;288895.277144;144447.638572;72223.819286;36111.909643;18055.954822;9027.977411;4513.988705;2256.994353;1128.497176;564.25;282.125;", "DELETE_TILES", "5", BNDRY, "DEFAULT", "DO_NOT_WAIT")

f.write("BaseMap Delete Tiles End:")
f.write(time.strftime('%x %X'))

# Write date/time
f.write("BaseMap CREATE Tiles start:")
f.write(time.strftime('%x %X'))

# create tiles
arcpy.ManageMapServerCacheTiles_server(Test1, "4622324.434309;2311162.217155;1155581.108577;577790.554289;288895.277144;144447.638572;72223.819286;36111.909643;18055.954822;9027.977411;4513.988705;2256.994353;1128.497176;564.25;282.125;", "RECREATE_ALL_TILES", "5", BNDRY, "DEFAULT", "DO_NOT_WAIT")

f.write("BaseMap CREATE Tiles End:")
f.write(time.strftime('%x %X'))




Basemap Delete Tiles start:9/9/2018 6:01:15 AM
Basemap  Delete Tiles End:9/9/2018 6:02:16 AM
Basemap  CREATE Tiles start:9/9/2018 6:02:16 AM
Basemap  CREATE Tiles End:9/9/2018 6:02:19 AM