[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
[20201112]tmpwatch 删除文件.txt
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Linux命令: touch tem.txt创建txt文件
touch tem.txt 创建txt文件
Linux命令 txt文件 linux 系统 编程