Recently found that there is a machine tmp placed under the innocent loss of files, and the detection is automatically lost, and, just delete files 10 days ago ....
I thought it was the one who wrote an auto-execute script, find the file deleted 10 days ago ....
As a result, the crontab schedule for all users is cleared, and no user has executed the automatic script
Monitored the server login, and no one logged in during the deletion of the file
Finally, through unremitting Baidu, finally found a positive solution
It is found from the/var/log/cron log that the server executes its own system in addition to the user's scheduled tasks, such as:
/etc/cron.hourly
/etc/cron.daily
Enter/etc/cron.daily
Can see a Tmpwatch
Cat Tmpwatch
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
You can see that a script called Tmpwatch is called, and we can see that the incoming parameters are meaningful to us./tmp 240
And then we man Tmpwatch
Synopsis
Tmpwatch [-u|-m|-c] [-MUADFQSTVX] [--verbose] [--force] [--all]
[--nodirs] [--nosymlinks] [--test] [--fuser] [--quiet]
[--atime|--mtime|--ctime] [--dirmtime] [--exclude <path>]
[--exclude-user <user>]
There is a hours
240 = 10*24 The whole good is 10 days
The specific reason is that TMP is a special folder, the system will automatically clean up, so it is best not to put the files in this place, was cleaned up is not good
About automatic deletion of files under Linux tmp