ShareFile Recycle Bin
As you might know, deleted items within a ShareFile Storage Zone are not permanently deleted right away. These deleted files go to the ShareFile Recycle Bin, which is accessible through the ShareFile Web App. It does not matter whether you remove files using the ShareFile Web App or the DriveMapper application, they all end up in the ShareFile Recycle Bin.
Within the ShareFile Web App Personal Folders, navigate to More Options, Recycle Bin.
From there you can delete your files permanently, or recover them. Recovering Items will restore them to the original location.
Deleting them permanently does just that, deleting the items permanent.
But where are these ShareFile Recycle Bin deleted items actually stored when using a On-Premises StorageZone? Well, just like all your On-Premises StorageZone data they reside within the StorageZone fileshare.
From there, these items are kept for 45 days by default so end users are able to recover data on their own. Every eight hours, preferably between 02:00 and 04:00 AM, a ShareFile cleanup job runs on the StorageZone fileshare, deleting the deleted items older than 45 days.
Amongst other values, the period for deleting items after 45 days can be adjusted to your needs.
These configuration values are being kept in the FileDeleteService.exe.config file, located in C:\inetpub\wwwroot\Citrix\StorageCenter\SCFileCleanSvc.
You can edit the file using Notepad. Before you continue, create a backup of the config file.
For instance, you can change the preferred time window for the cleanup job. Navigate to the following.
<!-- Start time for off-peak time of day. File deletion will preferably be scheduled during off-peak hours --> <!-- Permissible range: 00:00:00 to 23:59:59 --> <add key="OffPeakTimeOfDayStart" value="02:00:00"/> <!-- End time for off-peak time of day. File deletion will preferably be scheduled during off-peak hours --> <!-- Permissible range: 00:00:00 to 23:59:59 --> <!-- If OffPeakTimeOfDayEnd > OffPeakTimeOfDayStart, off-peak duration will end on the day after it starts --> <add key="OffPeakTimeOfDayEnd" value="04:00:00"/>
Change the values for OffPeakTimeOfDayStart and OffPeakTimeOfDayEnd to your needs.
Changing the default retention period
For changing the 45 day period, after which deleted items will be permanently deleted, an addition to the config file is needed. It is not there by default.
In order to do so I suggest navigating to the following section within the same FileDeleteService.exe.config file.
<!--Extended logging--> <add key="enable-extended-logging" value="0"/> <!--Delete the empty folders after all files within are deleted--> <add key="DeleteEmptyFoldersAfterFileDeletion" value="1"/>
Add the following between the extended logging section and the delete empty folders section.
<!--No. of days to keep data blob in active storage after deletion, adjust to your needs--> <add key="Period" value="90"/>
So, the final result of the partial config file looks like this.
<!--Extended logging--> <add key="enable-extended-logging" value="0"/> <!--No. of days to keep data blob in active storage after deletion, adjust to your needs--> <add key="Period" value="90"/> <!--Delete the empty folders after all files within are deleted--> <add key="DeleteEmptyFoldersAfterFileDeletion" value="1"/>
I guess you can put the Period option almost anywhere in the configuration file, but not in the Azure Specific Section. It is marked with Azure Specific.
<!--AZURE SPECIFIC--> <!--AZURE SPECIFIC-END-->
After changing any items in the configuration file you need to restart the Citrix Sharefile File Cleanup Service to activate the changed settings.
Remember, the default deletion period is 45 days. In this example I have set the period to 90 days. As a result, deleted items are being kept on the On-Premises StorageZone fileshare for 90 days so take this into consideration when sizing your StorageZone fileshare.
More info on Period option
Citrix has changed the Period to 45 days as of StorageZone Controller 4.0 which can be read in the Delete Service Default Period section here.
The period option is not there in the FileDeleteService.exe.config by default anymore when you install StorageZone controller 188.8.131.5299 or newer. This was the oldest 4.x version I was able to test. But you can put it back as needed.
From previous ShareFile projects I remembered that the period after which data is deleted permanently was actually there in the configuration file. In that configuration file it had an interval of 7 days. But was I mistaking? So I installed StorageZone controller 184.108.40.2062 and located the FileDeleteService.exe.config file to doublecheck.
And, as you can see, the 7 day Period option is right there after the Azure specific section for version 3.0.1 of StorageZone Controller.
So, if you ever need to change the default 45 day Recycle Bin retention period, you now know how to change it!