日期:2014-05-16 浏览次数:20985 次
[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用%% 挂载点
/dev/mapper/VolGroup-lv_root
14G 6.8G 6.0G 54% /
tmpfs 4.0G 176K 4.0G 1% /dev/shm
/dev/sda1 485M 51M 409M 11% /boot
/dev/sdb1 40G 8.5G 29G 23% /spmwls
/dev/sdb1 40G 8.5G 29G 23% /tmp
[root@localhost cron.daily]# pwd /etc/cron.daily [root@localhost cron.daily]# cat /etc/cron.daily/tmpwatch #! /bin/sh 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_*' 10d /tmp /usr/sbin/tmpwatch "$flags" 30d /var/tmp for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do if [ -d "$d" ]; then /usr/sbin/tmpwatch "$flags" -f 30d "$d" fi done3,再看cron的执行日志
Oct 10 03:11:03 localhost run-parts(/etc/cron.daily)[62997]: starting tmpwatch Oct 10 03:11:04 localhost run-parts(/etc/cron.daily)[63215]: finished tmpwatch 删除部分文件失败的日志 /etc/cron.daily/tmpwatch: error: failed to rmdir /tmp/weblogic1036/user_projects/domains/cmb/lib: Device or resource busy
4,备注: RHEL 6的cron的执行原理
[root@localhost lib]# cat /etc/anacrontab # /etc/anacrontab: configuration file for anacron # See anacron(8) and anacrontab(5) for details. SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root # the maximal random delay added to the base delay of the jobs RANDOM_DELAY=45 # the jobs will be started during the following hours only START_HOURS_RANGE=3-22 #period in days delay in minutes job-identifier command 1 5 cron.daily nice run-parts /etc/cron.daily 7 25 cron.weekly nice run-parts /etc/cron.weekly @monthly 45 cron.monthly nice run-parts /etc/cron.monthly