Technical article 105058

When I run the cleantmp script it removes random files from any currently mounted filesystems.

OpenServer 5.0.0

Written · Last revised

Problem

When I run the cleantmp script it removes random files from any currently mounted filesystems.

Cause

Cleantmp doesn't use the "-local" option in its "find" command; it will affect all mounted filesystems whether local or remote. These filesystems could have been mounted as a result of the on(NC) command, a previous mount(ADM) command, or a user using mnt(C).

Solution

The -local option must be added to the find command in the cleantmp script.

Log in as root.  Using a text editor such as vi(C), edit the
file /usr/lib/cleantmp.
In SCO OpenServer Release 5.0, there will be two entries that need
to be edited.  In SCO Open Server Release 3.0 or SCO UNIX System
V/386 Release 3.2 Operating System Version 4.2 with SCO TCP/IP                  Runtime System Release 1.2.1 added on, there will be one.

In SCO OpenServer Release 5.0, find the following two entries and add the "-local" option as indicated:

First entry:
if [ "$DIROPT" = TRUE ]
then
Change the text that reads:
tmpdirs="$tmpdirs `/bin/find $i -type d -mtime +$days
-depth -print`"
to read:
tmpdirs="$tmpdirs `/bin/find $i -local -type d -mtime +$days
-depth -print`"
Second entry:
Change the text that reads:
/bin/find $i ! -type p ! -type d -atime +$days -exec
/bin/rm -f {} \;
to read:
/bin/find $i ! -type p ! -local -type d -atime +$days -exec
/bin/rm -f {} \;
Save and exit this file.

In SCO OpenDesktop Release 3.0, find the following entry and add the -local option as indicated:

if [ -d $i ]
then
Change the text that reads:
         find $i -atime +$days -exec rm -f {} \;
else
to read:
find $i -local -atime +$days -exec rm -f {} \;
Save and exit this file.

See also

cleantmp(ADM)

From the Xinuos technical article database, record 105058. Reproduced with permission. The original is at www.sco.com/ta/105058, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.