-bash: crontab: command not found

[root@foss01 ~]# crontab -e

-bash: crontab: command not found

[root@foss01 ~]# yum install -y vixie-cron


[root@foss01 ~]# crontab -e

no crontab for root - using an empty one

crontab: installing new crontab

[root@foss01 ~]# chkconfig --list crond   -�鿴�Ƿ��ǿ�������

crond           0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@foss01 ~]# 



Linux���ö�ʱ����Ҷ�֪��ʹ��crontab���ϵͳ���ܣ�����ʱ��������Ҫ����û�ִ�У������ֱ��˵һ��2�ַ��������

����1��

ʹ������ crontab -e Ȼ��ֱ�ӱ༭��ʱ�ű���

����ִ���Ժ������û��Զ���ģ��ᱻд�� /var/spool/cron Ŀ¼�£����һ�����û���һ�µ��ļ����ļ����ݾ������DZ༭�Ķ�ʱ�ű���

�磺

[root@foss01 ~]# cd /var/spool/cron/

[root@foss01 cron]# ll

total 4

-rw------- 1 root root 70 Mar 31 10:36 root

[root@foss01 cron]# cat root

* */2 * * * /usr/sbin/ntpdate 192.168.20.37 >> /root/ntpdate.log 2>&1

����2��

ʹ������ vi /etc/crontab �༭��ʱ�ű���

ϵͳ���ģ���ϵͳ���������ǻ�ֱ������ /etc/crontab


[root@nhrnormal ~]# cat /etc/crontab 

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/


# For details see man 4 crontabs


# Example of job definition:

# .---------------- minute (0 - 59)

# |  .------------- hour (0 - 23)

# |  |  .---------- day of month (1 - 31)

# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...

# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

# |  |  |  |  |

# *  *  *  *  * user-name command to be executed

59 23 * * *   root /root/qingli.sh

���û����ģ�һ�㻹�ǽ�����ʹ�� crontab -e ������ϵͳҲ����ż���������õĽű��﷨��


你可能感兴趣的:(-bash: crontab: command not found)