< All Topics

Configuring a File Retention Policy

Hosted~FTP~’s file retention policy feature allows admins to set-up rules in your infrastructure, and when those criteria are met, to automatically delete files in your account. This feature is available starting at the Enterprise T2 bundle and above.

*Note: Please carefully read the rules and syntax parameters before activating your file retention policy. This is a destructive process that will permanently delete your files and be unrecoverable. We recommend contacting the support team to initially setup your policy rule.

Adding a New File Retention Policy

Going to the Policy tab, you’ll find a list of your existing policies in place to manage, or add a new policy. Click on the Add button located on the right-side menu to add a new policy. Please see table below to understand what to input into each field.


  • The rule is set on the owner of the folder and not the shared folder. (I.e. if you add a username in User + and they have read/write permissions to a shared folder – the rule will not work)
  • Files are deleted based on their “created date” which is defined as the date when the file was uploaded to the FTP site. Although the FTP and SFTP protocols allow you to set the last modified date to be different from the created date, the file retention policy feature works only against the created date.
  • Empty folders/sub-folders are not deleted regardless of the last modified date.
  • Files are deleted permanently. After the file retention policy deletes a file, it cannot be recovered.
  • The policy will run only once a day overnight, you will not see the results until the next day.


Syntax Parameters

  • Beginning of a folder path must have two forward slashes (//). i.e. //Mainfolder
  • Multiple folder paths or users can be separated by a space ” “.
  • If a folder path has a space, replace with syntax \s i.e.  /Main folder must be inputted as //Main\sfolder

Field Description
Policy Name Name of the policy
Action Default is Delete. Cannot be changed.
User + Include the folder owner usernames for where you want to target the file retention policy for.
User – Exclude users who you do not want to be affected by this policy
Folder + Specify the folder path (You can enable the include subfolders option).

Multiple folder paths are separated by a space, whereas spaces in the folder path are replaced with a \s 

Example 2 folder paths with a space:

/Mainfolder/sub folder and /Mainfolder/sub folder 2

will become

//Mainfolder/sub\sfolder/ //Mainfolder/sub\sfolder\s2/

Note: Add a / in front of the top level folder i.e. //Mainfolder/subfolder/

Folder – Exclude folders here separated by a space between multiple folder paths
File + Use a * to include all file extensions, or include specific file extensions and separate by a comma
File – Exclude file extensions here
Other Criteria Default is The uploaded date is older than. Cannot be changed.
Time Amount The amount of the unit specified
Time Unit Select your unit to measure the time amount: days, weeks, months, years
JavaScript Include any JavaScript here to customize the policy (contact support@hostedftp.com for additional assistance)
Active Check marking this option will enable the policy. Un-checking the option will disable the policy.


Once your settings have been confirmed, please click on Save to keep your policy saved. If the Active checkbox is enabled, as a result, it will also turn on the policy immediately. The policy will run only once a day overnight, you will not see the results until the next day.


Table of Contents