crontab 導入任務列表shell
crontab filename #導入任務列表,導入會把以前的清除
bash
[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