Please enable JavaScript to view this site.

Navigation: Technical Information > Cobwebb APIs & Commands

FLRTIDY - Folder Housekeeping

Scroll Prev Top Next More

From version 6.2.76 - This command must be run on the IBM i and can be used to delete old files from a folder on the IFS. This can be quite useful if you wish to tidy up folders used by the Cobwebb Folder Monitor.

If you wish to tidy multiple folder you may wish to configure these via the Work with Folder Housekeeping on the Cobwebb Tools menu. Online entries will then be processed by the FOLDERTIDY job that runs in the Cobwebb Job Scheduler (unless you have removed this entry).
Note: The Folder Housekeeping selects files at the root folder entry (i.e. not sub folders) and will only process *STMF files.

Make sure that you have the CPPD library in your library list.  To do this, enter the following command: -


If the library already exists in your library list, you will receive an error message, which you may ignore.  

Next enter FLRTIDY and press F4=Prompt.  

You will now be able to enter the path to the folder you wish to house-keep, together with a date type and days to retain if you are not happy with the defaults.

For example:

FLRTIDY PATH('/test/success') TYPE(M) DAYS(30)          

When the command runs an entry will be written to the joblog specifying the number of files that have been deleted. If you require the actual name of each file being deleted then you will need to change the Job Switch U8 on to enable Trace mode.        

Command Parameters

Folder path (PATH)

The folder path from which the files will be selected for deletion e.g. /test/success.

Date Type to check against (TYPE)

The type of date for the file you wish to be used for comparison. M=Last Modified date, A=Last Accessed date and C=Last Status Changed date. If you right click on a file in your folder and select Properties you will see the different dates.

Default = M

Number of days to retain (DAYS)

This allows you to specify how old a file needs to be before being included for deletion. Say you want to delete all files from the previous days output you would enter a 1 here and this would pick up any matching file of one day or older. Entering a 0 will not check the age of the file i.e delete ALL files. If you leave the default of 999 then nothing will happen unless you have files more than 999 days old.

Default = 30