linux下定时任务

1. /opt/test.sh

#!/bin/sh
cd /opt
java -jar test.jar

echo "1">>test.txt

 

//每天早上六点

2.crontab -e
0 6 * * * /opt/test.sh

 

ps:如果你用ssh远程客户端连接是看不到效果的。只能通过test.txt看到效果。

猜你喜欢

转载自bigdragon.iteye.com/blog/2366888