ITeye博客

linux下定时任务

wangyanlong0107 · 2017-03-31 16:59 · linix/Unix · 操作系统 · Markdown

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看到效果。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。