crontab定时任务中%代表换行,需要用\进行转义
例子:
crontab -l
*/5 * * * * /bin/ping -c 8.8.8.8 >/root/log/8.8.8.8/ping_`date +\%Y\%m\%d\%h\%m`