免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2048 | 回复: 1
打印 上一主题 下一主题

solaris, oarcle用户定时任务执行问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-02-08 10:50 |只看该作者 |倒序浏览
环境:soalris 10,oracle 10g
问题描述:
1、oracle用户的定时任务:
root # crontab -l oracle
0 3 * * * /opt/condata/back/exp_all.sh
0 2 * * * /opt/condata/file_remove.sh
0 1,5,9,13,17,21 * * * /opt/condata/arc_remove.sh

exp_all.sh:备份脚本
file_remove.sh:删除备份的脚本
脚本内容:find /opt/condata/back/ha_back -atime +1 -exec rm {} \;
arc_remove.sh:删除归档的脚本
脚本内容:find /opt/condata/arc/haeoms -atime +0 -exec rm {} \;

按照命令显示,应该是保留昨天2点以后直至今天的备份,但是最近几天查看都是保留的备份中有昨天2天以前的备份,查看了下定时日志:
**************************************
CMD: /opt/condata/file_remove.sh
>  oracle 591 c 一  2月  8 02:00:00 2010
<  oracle 591 c 一  2月  8 02:00:01 2010
>  CMD: /opt/condata/back/exp_all.sh
>  oracle 6118 c 一  2月  8 03:00:01 2010
*************************************

结果表明,定时任务是正常执行的。

问题:为什么保留的备份中会有昨天2点以前的备份?
(难不成是我对find命令中的-atime -n +n 有误解?我对- n的理解是:访问时间在n天以前的,0应该是说今天以前的,1应该是1天以前,这种理解不对么?)

论坛徽章:
0
2 [报告]
发表于 2010-02-08 11:26 |只看该作者
man find

The descriptions of -atime, -ctime, and -mtime use the  ter-
     minology n ``24-hour periods''. For example, a file accessed
     at 23:59 is selected by:

     example% find . -atime -1 print

     at 00:01 the next day (less than 24 hours  later,  not  more
     than one day ago). The midnight boundary between days has no
     effect on the 24-hour calculation.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP