免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: gaopengtttt
打印 上一主题 下一主题

我的CROND出问题了 [复制链接]

论坛徽章:
1
天秤座
日期:2013-10-23 13:20:42
11 [报告]
发表于 2009-12-14 13:27 |只看该作者
root@test3# crontab -l
* * 1 * * date >> /tmp/date.txt &2 > /dev/null
root@test3# crontab -l
-bash: /usr/bin/crontab: Permission denied
root@test3# crontab -e
-bash: /usr/bin/crontab: Permission denied
root@test3# crontab -e
-bash: /usr/bin/crontab: Permission denied
root@test3# ls -l /usr/bin/crontab
-rw-r--r-- 1 root root 315416 Jun 22  2007 /usr/bin/crontab
改成644,也只报如上的错误,和lz的还是不同

论坛徽章:
0
12 [报告]
发表于 2009-12-14 13:28 |只看该作者
[root@D0-LNXAPP33 ~]# ll /usr/bin/crontab
-rwsr-xr-x  1 ias10g oinstall 82772 Jul  8  2006 /usr/bin/crontab

论坛徽章:
0
13 [报告]
发表于 2009-12-14 13:29 |只看该作者
原帖由 gaopengtttt 于 2009-12-14 13:28 发表
[root@D0-LNXAPP33 ~]# ll /usr/bin/crontab
-rwsr-xr-x  1 ias10g oinstall 82772 Jul  8  2006 /usr/bin/crontab


我的CentOS5.x
6755
你的这里是4755
不过感觉没多大关系啊,你改成6755再试试。

论坛徽章:
0
14 [报告]
发表于 2009-12-14 13:31 |只看该作者
日志如下
Dec 14 11:10:01 D0-LNXAPP33 crond[24287]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 11:20:01 D0-LNXAPP33 crond[24485]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 11:20:01 D0-LNXAPP33 crond[24488]: (root) CMD (/root/Disk.sh >/tmp/log.txt >&1)
Dec 14 11:30:01 D0-LNXAPP33 crond[24704]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 11:40:01 D0-LNXAPP33 crond[24928]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 11:50:01 D0-LNXAPP33 crond[25307]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 11:56:05 D0-LNXAPP33 crontab[25422]: (root) LIST (root)
Dec 14 11:56:18 D0-LNXAPP33 crontab[25427]: (root) BEGIN EDIT (root)
Dec 14 11:56:21 D0-LNXAPP33 crontab[25428]: (root) LIST (root)
Dec 14 12:00:01 D0-LNXAPP33 crond[25495]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 12:01:01 D0-LNXAPP33 crond[25521]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 12:10:01 D0-LNXAPP33 crond[25753]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 12:12:36 D0-LNXAPP33 crontab[25811]: (root) LIST (root)
Dec 14 12:12:38 D0-LNXAPP33 crontab[25812]: (root) BEGIN EDIT (root)
Dec 14 12:20:01 D0-LNXAPP33 crond[25955]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 12:20:01 D0-LNXAPP33 crond[25958]: (root) CMD (/root/Disk.sh >/tmp/log.txt >&1)
Dec 14 12:27:46 D0-LNXAPP33 crontab[26137]: (root) BEGIN EDIT (root)
Dec 14 12:27:49 D0-LNXAPP33 crontab[26140]: (root) LIST (root)
Dec 14 12:30:01 D0-LNXAPP33 crond[26177]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 12:31:12 D0-LNXAPP33 crontab[26205]: (root) LIST (root)
Dec 14 12:33:38 D0-LNXAPP33 crontab[26263]: (root) LIST (root)
Dec 14 12:33:40 D0-LNXAPP33 crontab[26264]: (root) BEGIN EDIT (root)
Dec 14 12:33:46 D0-LNXAPP33 crontab[26292]: (oas10g6) LIST (oas10g6)
Dec 14 12:35:17 D0-LNXAPP33 crontab[26366]: (root) LIST (root)
Dec 14 12:40:01 D0-LNXAPP33 crond[26453]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 12:50:01 D0-LNXAPP33 crond[26835]: (root) CMD (/usr/lib/sa/sa1 1 1)
Dec 14 12:59:53 D0-LNXAPP33 crontab[27040]: (root) LIST (root)
[root@D0-LNXAPP33 ~]# date
Mon Dec 14 13:00:05 CST 2009

我的root用户下还挂得有CRONTAB。我没做任何操作。。

论坛徽章:
0
15 [报告]
发表于 2009-12-14 13:33 |只看该作者
还是不行
[root@D0-LNXAPP33 ~]# chmod 6755  /usr/bin/crontab
[root@D0-LNXAPP33 ~]# crontab -l
cron/root: Permission denied
[root@D0-LNXAPP33 ~]# ll /usr/bin/crontab
-rwsr-sr-x  1 ias10g oinstall 82772 Jul  8  2006 /usr/bin/crontab

论坛徽章:
0
16 [报告]
发表于 2009-12-14 13:33 |只看该作者
是这个版本
[root@D0-LNXAPP33 etc]# more redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

论坛徽章:
0
17 [报告]
发表于 2009-12-14 13:36 |只看该作者
-rwsr-xr-x  1 ias10g oinstall 82772 Jul  8  2006 /usr/bin/crontab

居然OWNER 和GROUP 是ias10g oinstall
我才发现。。
[root@D0-LNXAPP33 etc]# chown root /usr/bin/crontab
[root@D0-LNXAPP33 etc]# chgrp root /usr/bin/crontab
[root@D0-LNXAPP33 etc]# crontab -l
00 19 * * 1-5 /home/oas10g2/backup/back_gims.sh > /dev/null 2> &1
20 19 * * 1-5 /home/oas10g2/backup/ftp_uat_gims.sh > /dev/null 2> &1
00 20 * * 1-5 /home/oas10g3/backup/back_ipss.sh > /dev/null 2> &1
30 20 * * 1-5 /home/oas10g3/backup/ftp_uat_ipss.sh > /dev/null 2> &1
00 21 * * 1-5 /home/oas10g4/backup/back_dcss.sh > /dev/null 2> &1
30 21 * * 1-5 /home/oas10g4/backup/ftp_uat_dcss.sh > /dev/null 2> &1
20 * * * * /root/Disk.sh >/tmp/log.txt >&1

论坛徽章:
0
18 [报告]
发表于 2009-12-14 13:39 |只看该作者
现在root用户可以了但是其他用户还是不行。。
[root@D0-LNXAPP33 ~]# su - oas10g
[oas10g@D0-LNXAPP33 ~]$ crontab
cron/tmp.XXXXpD1jIE: Permission denied
[oas10g@D0-LNXAPP33 ~]$ crontab -l
cron/oas10g: Permission denied
[root@D0-LNXAPP33 ~]# su - oas10g6
[oas10g6@D0-LNXAPP33 ~]$ crontab -l
cron/oas10g6: Permission denied

我晕

论坛徽章:
0
19 [报告]
发表于 2009-12-14 13:42 |只看该作者
我靠
[root@D0-LNXAPP33 ~]# chmod 6777 /usr/bin/crontab
[root@D0-LNXAPP33 ~]# ll /usr/bin/crontab
-rwsrwsrwx  1 root root 82772 Jul  8  2006 /usr/bin/crontab
[root@D0-LNXAPP33 ~]# su - oas10g6
[oas10g6@D0-LNXAPP33 ~]$ crontab -l
no crontab for oas10g6
可以了。。。
啥原因我不知道啊
一般都是
-rwsr-xr-x  1 root root 66321 Dec  8  2004 /usr/bin/crontab
真他妈的郁闷啊。。

论坛徽章:
0
20 [报告]
发表于 2009-12-14 13:53 |只看该作者
原帖由 gaopengtttt 于 2009-12-14 13:36 发表
-rwsr-xr-x  1 ias10g oinstall 82772 Jul  8  2006 /usr/bin/crontab

居然OWNER 和GROUP 是ias10g oinstall


刚才没注意到哦。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP