[14577] in Athena Bugs
Re: sun4 8.0I: tmp area files ....
daemon@ATHENA.MIT.EDU (jawetzel@MIT.EDU)
Wed Aug 21 01:55:46 1996
From: jawetzel@MIT.EDU
To: cfields@MIT.EDU
Cc: bugs@MIT.EDU
Date: Wed, 21 Aug 1996 01:55:41 EDT
>> Wouldn't it be nice if you actually checked if someone is still logged on
>> before cleaning the tmp areas. There might even be files in these temp
>> areas which someone is currently using.
> While it's true that it does not check if anyone is logged in, it also
> does not remove files "which someone is currently using." The file
> must have not been accessed for a day or two before it will be
> removed.
Let's take a look at the clean_tmp_areas script:
set timeout = ( "-atime +1" "-atime +2" "-mtime +3" "-mtime +3")
.
.
.
find . $xdev $timeout[$j] $exceptions -exec rm -f {} \; -print
Now from the stat man page:
st_atime Time when file data was last accessed. Changed by
the following functions: creat, mknod, pipe,
utime, and read.
st_mtime Time when data was last modified. Changed by the
following functions: creat, mknod, pipe, utime,
and write.
Now imagine the following scenerio. I have a program that is running for a
number of days. It creates a file in the /tmp directory and every 4 hours
or so it writes something to that file. Opening the file would update the
access time and the modification time. However, writing to the file does
not alter the access time. If the access time is not altered, wouldn't
this script always delete the file after one day even if it has been
modified during that time period?
Jake