arcgisuploads\scratch full of attachments uploaded from feature service

1933
3
Jump to solution
10-21-2012 08:43 PM
JackZHANG
Occasional Contributor II
Hello,
can any one please tell me what the "arcgisserver\directories\arcgissystem\arcgisuploads\scratch" directory's for?

For some reasons all the photos uploaded via one of our feature service are saved under the folder. The photos supposed to be uploaded to our SDE database (SQL Sever), which apparently they did but the system kept a copy of the photos in the scratch folder and it's eating up the disc storage. This looks like a new "feature" in 10.1. Is there a way to disable keep copy in the scratch folder or at least limit the size? Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JackZHANG
Occasional Contributor II
ESRI has came back to me confirmed it's a bug/enhancement. The current solution is create windows scheduled task to clean up the directory.

[#NIM086603  Enhancement Request: Allow modification of arcgisuploads folder settings either in Server Manager or Admin API ]
[#NIM086601  The arcgisuploads folder and subdirectories do not remove files on a scheduled basis as configured by default ]

View solution in original post

0 Kudos
3 Replies
JackZHANG
Occasional Contributor II
Response from ESRI Support:

"Have to taken a look at the .json endpoints directly for the directories located typically at C:\arcgisserver\config-store\serverdirs - within the arcgisuploads.json file there is an option there to change the time for clearing this directory. Changing this to say 10 minutes will allow the server to clean this directory. This is not technically supported but may resolve your issue as it states in the article http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000002w5000000 that "The cache and system directories are not cleaned because their contents are expected to be always available" - so therefore this is only done be default for the jobs and output directory.

The arcgissystem directory is the parent folder of arcgisuploads and so the configuration would be inherited. You will only want the clearup to be applied to the uploads folder and not the other sub-directories under arcgissystem.

From reading the documentation the scratch folder is only intended to be temporary storage and so in the document http://resources.arcgis.com/en/help/main/10.1/index.html#/Scratch_Folder/001w00000046000000/ it mentions that �??Files written to the Scratch Folder are not automatically deleted. You need to do your own cleanup�?� �?? so if you want the server to do this then you can change the arcgisuploads.json. You would need to check in your SDE that the uploads have been added (they will more than likely be blob entries) and shouldn�??t be linked to this folder. However as a test you could rename the uploads folder and test that your attachments still work.

You will need to stop the SOM service to release the locks."
0 Kudos
JackZHANG
Occasional Contributor II
Just talked to Support for ESRI AU. We both agreed the Scratch folder only hold the files for as long as necessary before they are added to the database and then removed when not needed, but in action its behaviours is different, and here is the prove:

I created a feature via the feature service on my ArcGIS online map, and added a photo attachment to feature. I could immediately see the photo in the scratch folder on the server. Next I renamed the photo on the server to see if I could download it from the serer to the iPad, and the answer is YES, which means the photo has been  saved in the SDE database. So I rename the photo back to its original and waited for 24 hours to see it will be deleted, and this time the answer is NO, the photo is still right there and I can assure no one has touched it during the 24 hours.

The arcgisuploads.json file has maxfileage = 1440minutes (24hrs) by default, however  seems this rule doesn't get applied because its parent folder configure (arcgisystem.json) has maxfileage = none.

Has anyone noticed the same issue? maybe you should check your '\arcgisserver\directories\arcgissystem\arcgisuploads\scratch' folder if you enabled attachment for your feature service.

Anyway I'm still asking for a solution, if anyone has please help. Thank you.
0 Kudos
JackZHANG
Occasional Contributor II
ESRI has came back to me confirmed it's a bug/enhancement. The current solution is create windows scheduled task to clean up the directory.

[#NIM086603  Enhancement Request: Allow modification of arcgisuploads folder settings either in Server Manager or Admin API ]
[#NIM086601  The arcgisuploads folder and subdirectories do not remove files on a scheduled basis as configured by default ]
0 Kudos