KB Article #72161

Removing cftsu***** and cftsu****.err from /tmp

Problem

We have CFTCRONs that execute a script every 5 minutes. What we have discovered is that upon every execution, CFTCRON is creating 2 files in the /tmp filesystem named cftsu***** and cftsu****.err



This has caused an issue with disk/swap space.


Resolution


There are four types of temporary files corresponding to different types of actions:



/tmp/cftlo* files are produced during the log switching procedure
/tmp/cftcn* files are produced when the accounting feature is enabled
/tmp/cftsu* files are produced when end of transfer procedures are run
/tmp/cftsu*.err files correspond to the results of commands in the cftsu* files



Deleting temporary files
Transfer CFT cannot delete temporary files automatically. It does not know exactly when the end of the user script is reached.



To avoid saturating the /tmp directory, you should end any shell procedure with the rm $0 command.



Note: If this command is omitted, the /tmp partition rapidly becomes full and the end of transfer procedures will fail.



This command deletes the procedure that runs it and is applicable to cftlo*, cftfcn* and cftsu* files.



Additionally, the cftsu*.err files associated with cftsu* files should be deleted. However, to avoid losing any errors that may be logged in this file, it is best to check that the file is empty before deleting it.