标签:art sbin org centos moni 模式 任务 ntp mysq
非交互模式直接写入crontab -eroot@centos-mysql01:~# crontab -l
*/5 * * * * chkrootkit_everyday.sh > dev/null 2>&1
*/20 * * * * /usr/sbin/ntpdate pool.ntp.org > /dev/null 2>&1
* * * * * /usr/bin/php /data/monitor/artisan schedule:run > /dev/null 2>&1
root@centos-mysql01:~# (crontab -l;echo "*/5 * * * * /data/sh/chkrootkit_everyday.sh > /dev/null 2>&1 ") | crontab
root@centos-mysql01:~# crontab -l
*/5 * * * * chkrootkit_everyday.sh > dev/null 2>&1
*/20 * * * * /usr/sbin/ntpdate pool.ntp.org > /dev/null 2>&1
* * * * * /usr/bin/php /data/monitor/artisan schedule:run > /dev/null 2>&1
*/5 * * * * /data/sh/chkrootkit_everyday.sh > /dev/null 2>&1
root@centos-mysql01:~# crontab -l|grep -v "monitor"|crontab
root@centos-mysql01:~# crontab -l
*/5 * * * * chkrootkit_everyday.sh > dev/null 2>&1
*/20 * * * * /usr/sbin/ntpdate pool.ntp.org > /dev/null 2>&1
*/5 * * * * /data/sh/chkrootkit_everyday.sh > /dev/null 2>&1
root@centos-mysql01:~# crontab -l | grep -v "dev" | crontab #删除全部定时任务
root@centos-mysql01:~# crontab -l
root@centos-mysql01:~# crontab -l;echo "*/5 * * * * /data/sh/chkrootkit_everyday.sh > /dev/null 2>&1
> */20 * * * * /usr/sbin/ntpdate pool.ntp.org > /dev/null 2>&1
> */5 * * * * /data/sh/chkrootkit_everyday.sh > /dev/null 2>&1"|crontab
root@centos-mysql01:~# crontab -l
*/5 * * * * /data/sh/chkrootkit_everyday.sh > /dev/null 2>&1
*/20 * * * * /usr/sbin/ntpdate pool.ntp.org > /dev/null 2>&1
*/5 * * * * /data/sh/chkrootkit_everyday.sh > /dev/null 2>&1
标签:art sbin org centos moni 模式 任务 ntp mysq
原文地址:http://blog.51cto.com/9025736/2334457