Turn from: http://blog.itpub.net/133735/viewspace-773854/
The Hadoop system Datanode and Tasktracker's PID files are cleared.
So conveniently looked at the next,/tmp directory cleaning rules.
The Linux development specification does not explicitly indicate the cleanup rules for the/tmp directory, but specifies that the system must have a/tmp directory.
All distributions are inconsistent, and the general practice is that a host reboot clears the/tmp directory
The clean Rules for the/TMP directory are defined in Linux/etc/cron.daily/tmpwatch, different distributions are inconsistent, but there is a general customization of this timing task.
01 |
[Root@test740-10 cron.daily]# VI Tmpwatch |
04 |
/usr/sbin/tmpwatch "$flags"-x/tmp/. X11-unix-x/tmp/. Xim-unix \ |
05 |
-x/tmp/.font-unix-x/tmp/. Ice-unix-x/tmp/. Test-unix 240/tmp |
06 |
/usr/sbin/tmpwatch "$flags" 720/var/tmp |
07 |
For D In/var/{cache/man,catman}/{cat?,x11r6/cat?,local/cat?}; Todo |
09 |
/usr/sbin/tmpwatch "$flags"-F 720 "$d" |
According to the man Tmpwatch this command will know. Clears the files below the/tmp directory for 30 days without access.
You can also add custom code to accomplish specific tasks in accordance with your own rules.