1. 请确保手工可以执行该文件
chmod 775 test.sh
2. 确认开始crond服务(service crond status/start/stop)
首先确认服务器是否开启任务计划服务,只有root用户才能对crond服务进行开启和关闭
[root@enfo124 ~]# service crond status
crond (pid 1758) is running…
[root@enfo124 ~]# service crond stop
Stopping crond: [ OK ]
[root@enfo124 ~]# su - cognos
[cognos@enfo124 ~]
servicecrondstatuscrondisstopped[cognos@enfo124 ]
su - root
[root@enfo124 ~]# service crond start
Starting crond: [ OK ]
[root@enfo124 ~]# service crond status
crond (pid 2805) is running…
[root@enfo124 ~]# su - cognos
[cognos@enfo124 ~]$ service crond status
crond (pid 2805) is running…