Script Library

Sample scripts are provided as-is with no warranty of fitness for a particular purpose. These scripts are solely intended to demonstrate techniques for accomplishing common tasks. Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.


delete_old_files_event.s

Download

Robo-FTP Server provides a powerful event-driven automation interface which enables you to launch Robo-FTP scripts in response to events such as a user logging on, uploading a file, etc. This interface is called Server Event Scripts.

The sample script below could be triggered by either the Logon or Logoff event, or both. When triggered, it removes files over 30 days old from the current user's root folder and any physical (non-virtual) subfolders. This type of automation can prevent the server administrator having to periodically clean up after users that are prone to leaving old files on the server.

To configure Robo-FTP Server to launch the event script at the appropriate time, follow these steps:

  • Download this sample script and save it as delete_old_files_event.s (use link above)
  • Launch Robo-FTP Server Console
  • Select Automation in the navigation bar on the left
  • Select "Enable for all" under Server Event Scripts on the right
  • Select "Logon" from the Server Event drop-down list
  • In the Event Script File Name box enter the full path to the delete_old_files_event.s script file that you saved earlier
  • Click the Apply button

  1  LOG "delete_old_files_event.log" /append /maxsize=1000  
  2  SET CutOffDate = %date 
  3  DATESUB CutOffDate 30   
  4  DELETE "*" /olderthan=CutOffDate /subdirs 

Browse complete list of scripts