写一个crontab脚本,定时执行 */1 * * * * cd /home/batch/ && ./test.sh >/home/batch/log/test.log Tips: >为覆盖输出, >>为增量输出.