陈三肾
|
在crontab -e添加了一条 */1 * * * * docker exec nginx /usr/sbin/nginx -V > /root/nginx2.st 发现nginx2.st会被改成空白的,而直接运行docker exec nginx /usr/sbin/nginx -V > /root/nginx2.st,也是一样会将nginx2.st改写为空白,可是如果运行docker exec -it nginx /usr/sbin/nginx -V > /root/nginx2.st,加了-it就可以保存输出到nginx2.st,但是在crontab里面还是空白,cron log只记录这两句
Jan 15 13:42:01 ETCL CROND[21900]: (root) CMD (docker exec nginx /usr/sbin/nginx -V > /root/nginx2.st) |
2018-01-15 15:05:11