1.安裝
# yum install vixie-cron # yum install crontabs # chkconfig crond on #設為開機啟動,先要安裝chkconfig(yum install chkconfig) # service crond start #啟動 # service crond stop #停止 # service crond start //啟動服務 # service crond stop //關閉服務 # service crond restart //重啟服務 # service crond reload //重新載入配置 # service crond status //查看crontab服務狀態 # /etc/rc.d/init.d/crond restart #重啟 # /etc/rc.d/init.d/crond reload #不中斷服務,重新載入配置
2.使用
# crontab -e 編輯配置文件 #crontab -u <-l, -r, -e> # crontab -u 指定一個用戶 # crontab -l 列出某個用戶的任務計划 # crontab -r 刪除某個用戶的任務 # crontab -e 編輯某個用戶的任務
