[lug] ls -l /var/tmp = drwxrwxrwt 16 root root

John Karns jkarns at csd.net
Fri Mar 23 08:07:53 MST 2001


On Tue, 20 Mar 2001, Bob Collins said:

>I will see if a different directory can be used for the
>temporary files.  I remember reading in the man page that
>/var/tmp was the default, so it sounds like I could change
>it.
>

>I never did let ls finish, but I am sure it would have taken
>a very long time to do the same thing. 

SuSE provides a cron job that will prune the tmp file.  You just have to
enable it in /etc/rc.config:

#
# cron.daily can check for old files in tmp-dirs. It will delete all files
# not accessed for more than MAX_DAYS_IN_TMP. If MAX_DAYS_IN_TMP is not
# set or set to 0, this feature will be disabled.
#
MAX_DAYS_IN_TMP="8"

#
# You can specify in TMP_DIRS_TO_CLEAR, which directories have to be
# searched for old files, to be deleted.
TMP_DIRS_TO_CLEAR="/tmp /var/tmp"

#
# In OWNER_TO_KEEP_IN_TMP, you can specify, whoms file shall not be
deleted.
#
OWNER_TO_KEEP_IN_TMP=""


The 'MAX_DAYS_IN_TMP' is set to '0' by the install procedure.  Also the
'OWNER_TO_KEEP_IN_TMP' is set to root.  If you're not interested in
keeping any temp files, I think it's safe to set it to blank in which case
roots tmp files will be deleted also.  I haven't run into any known
problems doing it this way.  Since the comment says that only files which
haven't been accessed during the MAX_DAYS period will be deleted, I don't
think it's a problem.  Then you shouldn't have to worry about manually 
deleting tmp files.

----------------------------------------------------------------------
John Karns                                              jkarns at csd.net





More information about the LUG mailing list