crontab 導入任務列表

crontab 導入任務列表

crontab filename      #導入任務列表,導入會把之前的清除


[root@host]# crontab -l | grep -v "#" > file.txt
[root@host]# echo "* * * * * echo ok" >> file.txt
[root@host]# crontab file.txt


[root@host]# cat file.txt 
MAILTO=""
*/30 * * * * sh /usr/shell/updatetime.sh

[root@host]# crontab file.txt 

[root@host]# crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (file.txt installed on Thu Aug 21 11:00:57 2014)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
MAILTO=""
*/30 * * * * sh /usr/shell/updatetime.sh

[root@host]# /etc/init.d/crond restart


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章