santrix

Well-Known Member
Nov 30, 2008
229
3
68
Hi...

I noticed old session files just building up in /tmp on one of my servers. Loking at /etc/cron.daily/tmpwatch I see:

Code:
flags=-umc
/usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/.XIM-unix \
	-x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix 240 /tmp
/usr/sbin/tmpwatch "$flags" 720 /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
    if [ -d "$d" ]; then
	/usr/sbin/tmpwatch "$flags" -f 720 "$d"
    fi
done
I don't understand the flags=-umc statement. If I test the statement using umc, then it won't remove the old sess* files..., although according to the man page

"If the --atime, --ctime or --mtime options are used in combination, the decision about deleting a file will be based on the maximum of these times. The --dirmtime option implies ignoring atime of directories, even if the --atime option is used."
using -umc should INCREASE the chances of deleting a file, not reduce it...

But if I remove the "u" from the switches, then the sess* files get removed... This seems to contradict the explanation in the man page completely.

Steve
 
Last edited:

santrix

Well-Known Member
Nov 30, 2008
229
3
68
Found it... tmpwatch has some ambiguous/flaky grammar in the man page.

https://bugzilla.redhat.com/show_bug.cgi?id=468670

Might clarify if it said:

"If the --atime, --ctime or --mtime options are used in combination, the decision about deleting a file will be based on the maximum (latest) of these times. The --dirmtime option implies ignoring atime of directories, even if the --atime option is used."
Maximum time as per file unix timestamp, but for most people the maximum time being talked about is usually interpreted as meaning the difference between the timestamp and now().

Oh, just delete this thread, I'm rambling.