Support

Register your Product

Product Documentation

Knowledge Base

Contact Support

Community

User Group

Resources

Application Library

Flow Library

Script Library

Recycle Bin

This script defines a number of parameters that determine when a file should be deleted permanently. E.g. file size, number of files, age, etc.

Information

Supported by: PowerSWITCH (MAC and WIN)
Language: JavaScript

Description:

The script allows you to delete files in an automated way dependant on the following parameters:

  • Maximum disk space (MB): the total disk space of all files present in the preceding folder can not be more than this value.
  • Maximum job size (MB): any single job or file of which the file size is more than this value will be deleted.
  • Maximum number of jobs: if the number of jobs or files exceeds this value the oldest jobs will be deleted.
  • Older than (days): all files or jobs older than a certain amount of days are to be deleted.
  • Check age of files every (min): this property determines how long the script should wait before it checks again how old a file is (minutes)

All properties can be combined; if 1 of these settings is valid, the job or file will be deleted. You can use -1 as value if you want a certain property to be ignored.

Using this script

  • Download and save the script on your computer: download script.
  • Select the Script element in your PowerSWITCH flow and browse to the script in the Script package property.
    or
  • Open the script in the SWITCHscripter and change it to your needs .

Example flow

  • Move to Recycle Bin

    All files in the 'Archive' folder will stay in this folder until more than 100 file are present or the total of all files is more than 500 MB. The oldest files (i.e. the first ones that arrived in the Archive folder) will be deleted first.

  • Archive FTP Server for 2 months

    All files and jobs are downloaded from the FTP server and stored in the archive folder. They stay in this folder for 60 days and are then deleted by the Recycle Bin script.

© Copyright 2007 by Gradual Software.