ITPub博客

首页 > 数据库 > Oracle > crontab不能自动删除归档日志

crontab不能自动删除归档日志

原创 Oracle 作者:parknkjun 时间:2015-07-16 00:02:30 0 删除 编辑
某客户一套数据库归档太多撑满磁盘,于是决定使用脚本自动删除归档,保留15天,脚本执行没有任何问题
但是放在crontab里就是执行不成功,log也没有产生,查不到原因,后来发现crontab执行完会自动发信息到mail里面
于是在/var/spool/mail/路径下找到oracle文件:
[oracle@jzh5 2015_07_15]$ cd /var/spool/mail/
[oracle@jzh5 mail]$ ls
oracle  root  rpc
[oracle@jzh5 mail]$ vi oracle 
/bin/sh: /home/oracle/delete_arc.sh: Permission denied
From oracle@jzh5.oracle.com  Wed Jul 15 15:19:01 2015
Return-Path:
Received: from jzh5.oracle.com (localhost.localdomain [127.0.0.1])
        by jzh5.oracle.com (8.13.8/8.13.8) with ESMTP id t6F7I1nS004101
        for ; Wed, 15 Jul 2015 15:19:01 +0800
Received: (from oracle@localhost)
        by jzh5.oracle.com (8.13.8/8.13.8/Submit) id t6F7I1Lr004098;
        Wed, 15 Jul 2015 15:18:01 +0800
Date: Wed, 15 Jul 2015 15:18:01 +0800
Message-Id: <201507150718.t6F7I1Lr004098@jzh5.oracle.com>
From: root@jzh5.oracle.com (Cron Daemon)
To: oracle@jzh5.oracle.com
Subject: Cron /home/oracle/delete_arc.sh
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/bin/sh: /home/oracle/delete_arc.sh: Permission denied
From oracle@jzh5.oracle.com  Wed Jul 15 15:21:01 2015
Return-Path:
Received: from jzh5.oracle.com (localhost.localdomain [127.0.0.1])
        by jzh5.oracle.com (8.13.8/8.13.8) with ESMTP id t6F7K1iE004121
        for ; Wed, 15 Jul 2015 15:21:01 +0800
Received: (from oracle@localhost)
        by jzh5.oracle.com (8.13.8/8.13.8/Submit) id t6F7K1Aa004118;
        Wed, 15 Jul 2015 15:20:01 +0800
Date: Wed, 15 Jul 2015 15:20:01 +0800
Message-Id: <201507150720.t6F7K1Aa004118@jzh5.oracle.com>
From: root@jzh5.oracle.com (Cron Daemon)
To: oracle@jzh5.oracle.com
Subject: Cron /home/oracle/delete_arc.sh
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/bin/sh: /home/oracle/delete_arc.sh: Permission denied

原来是delete_arc.sh脚本没有权限,修改权限[oracle@jzh5 ~]$ chmod 775 delete_arc.sh 后就OK了。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10271187/viewspace-1734629/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
DBA攻城狮

注册时间:2008-02-11

  • 博文量
    115
  • 访问量
    539482