  | |  | using combination of mtime & atime with tmpwatch | using combination of mtime & atime with tmpwatch 2003-07-21 - By Tom Georgoulias
Back Last night tmpwatch cleaned up some user files in /tmp before the user's job was finished using them. The files were being written to, not read from, during the entire run. In order to prevent this from happening again in the future, I'd like to specify that tmpwatch not delete a file unless BOTH the mtime and atime are older than X hours.
According to the manpage for tmpwatch, when mtime & atime are used together, the deletion is based on the "maximum of these times." Does this mean that once either the atime OR the mtime exceeds X hours the file will be deleted, or the file will be deleted after BOTH the mtime and atime exceed X hours?
Tom
Excerpt of man tmpwatch: == " By default, tmpwatch dates files by their atime (access time), not their mtime (modification time). If files aren't being removed when ls -l implies they should be, use ls -u to examine their atime to see if that explains the problem.
If the --atime, --ctime or --mtime options are used in combination, the decision about deleting a file will be based on the maximum of this times. ==
Earn $52 per hosting referral at Lunarpages.
|
|
 |