HOW TO

Automate running ArcGIS Data Store command utilities

Last Published: February 27, 2024

Summary

To monitor and archive the ArcGIS Data Store health and status, it may be beneficial to automate running an ArcGIS Data Store command utility, like describedatastore, and save the output to log files.

Procedure

This can be done by following the steps below:

  1. On the ArcGIS Data Store machine, if a Python environment is not already installed, installĀ Python 3.x.
  2. Create a .py file and paste the below script in it:
import os
from datetime import datetime 

time = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
DescribeDataStoreBatFile = r"C:\Program Files\ArcGIS\DataStore\tools\describedatastore.bat"
OutputResultsFolder = r"C:\DescribeDataStoreResults"

DescribeDataStore = os.popen(DescribeDataStoreBatFile)
DescriptionOutput = DescribeDataStore.read()
DescribeDataStore.close()

OutputFile = open(os.path.join(OutputResultsFolder,f"Output{time}.log"),"w+")
OutputFile.write(DescriptionOutput)
OutputFile.close()
  1. Edit the DescribeDataStoreBatFile parameter to point to the path of the .bat file.
  2. Edit the OutputResultsFolder parameter to point to the folder path where you want the log files to be generated.
  3. Automate running the script using Windows Task Scheduler.
Note:
If you have any issues with permissions, or if the script creates empty files, please consult your IT department before doing the following steps.
  1. In the Local Security Policy app, go to User Rights Assignment, log on as a batch job, and add the ArcGIS service account.
  2. In Edit Local Users and Groups > Groups > Administrator Groups. add the ArcGIS service account.

Article ID: 000031821

Software:
  • ArcGIS Data Store

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options