首先,我很抱歉,如果这是错误的堆栈交换,但它看起来是正确的。
这是我现在的crontab:
MAILTO=****@gmail.com 10,30,50 * * * * ~/webapps/****/apache2/bin/start */10 * * * * /usr/local/bin/python2.7 ~/webapps/****/WR/cron.py > ~/webapps/****/WR/cron.log 2>&1
但是每当输出放入cron.log文件时,所有旧内容都会被覆盖。 我该如何阻止? 或者,如果不可能,还有什么替代方法?
注意:URL和电子邮件中的****用于隐藏个人信息。
交换>为>> 。
> = write to file, overwriting what was already there >> = append to file, create if it doesn't exist
即:
MAILTO=****@gmail.com 10,30,50 * * * * ~/webapps/****/apache2/bin/start */10 * * * * /usr/local/bin/python2.7 ~/webapps/****/WR/cron.py >> ~/webapps/****/WR/cron.log 2>&1