[20201112]tmpwatch 删除文件.txt

--//tmpwatch命令用来removes files which haven't been accessed for a period of time。
--//一般发布版本用来通过crond调用tmpwatch删除一定时间内不使用的文件。

# cat /etc/cron.daily/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 \
        -X '/tmp/hsperfdata_*' 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

--//flags=-umc表示
-u, --atime
    Make the decision about deleting a file based on the file's atime (access time). This is the default.
    Note that the periodic updatedb file system scans keep the atime of directories recent.

-m, --mtime
    Make the decision about deleting a file based on the file's mtime (modification time) instead of the atime.

-c, --ctime
    Make the decision about deleting a file based on the file's ctime (inode change time) instead of the atime; for
    directories, make the decision based on the mtime.

# man

 tmpwatch [-u|-m|-c] [-MUXadfqstvx] [--verbose] [--force] [--all]
                [--nodirs] [--nosymlinks] [--test] [--fuser] [--quiet]
                [--atime|--mtime|--ctime] [--dirmtime] [--exclude