crontab定時任務中%代表換行,需要用\進行轉義
例子:
crontab -l
*/5 * * * * /bin/ping -c 8.8.8.8 >/root/log/8.8.8.8/ping_`date +\%Y\%m\%d\%h\%m`