clrtmp - Clear the /tmp directory

Synopsis

clrtmp [-c]

Description

The clrtmp utility clears the /tmp directory by removing all of the objects from it. On other systems, the /tmp directory is cleared each time the system is started. On i5/OS, the /tmp directory is not cleared when the system is started. You can include a call to the clrtmp utility from the startup program specified by the QSTRUPPGM system value to have the /tmp directory cleared when i5/OS is started.

To remove objects from the /tmp directory the caller of clrtmp must have *WX authority to each subdirectory contained in /tmp and *OBJEXIST authority to each object. If the caller does not have the required authority those objects are not removed from the /tmp directory.

Unpredictable results may occur if clrtmp is called while the system is running. For example, if another program is writing to a file in the /tmp directory, the path to the file is removed and you will not be able use the file.

Note:
This utility is unique to i5/OS.

Options

-c
Create /tmp if it does not exist.

Exit status

  • 0 when successful
  • >0 when an error occurs or at least one object could not be removed from the /tmp directory