【crontab 定时任务】

来源:互联网 发布:mac打开exe文件 编辑:程序博客网 时间:2024/05/20 14:43


【相关命令】

#修改定时任务命令

crontab -e 


#查看邮件位置

vim /var/mail/root

// service sendmai status --- 这个任务记得开启!


#查看调用调试日志

vim /var/log/cron


例子(将 /etc/crontab 的内容都复制到这边)

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/php5.4/bin
MAILTO=xxxx@qq.com

*/5 * * * * /usr/local/agenttools/agent/check_tmp_agent.sh >/dev/null 2>&1
#secu-tcs-agent monitor, install at Wed Mar 15 19:28:35 CST 2017
* * * * * /usr/local/sa/agent/secu-tcs-agent-mon-safe.sh  > /dev/null 2>&1
*/1 * * * * /usr/local/qcloud/stargate/admin/start.sh > /dev/null 2>&1 &
*/20 * * * * /usr/sbin/ntpdate ntpupdate.tencentyun.com >/dev/null &
01 00 * * * echo "This is the test message" >> /opt/www/default/clients/shop_yaqi/shell/test_log.txt
22 * * * * php /opt/www/default/clients/shop_yaqi/php/get_token.php

原创粉丝点击