---
title: "linux下定时任务"
author: "wangyanlong0107"
date: "2017-03-31T16:59:07Z"
tags: []
categories: ["操作系统"]
slug: "linux"
draft: false
lastmod: "2017-03-31T16:56:28Z"
id: 2366888
url: "https://bigdragon.iteye.com/blog/2366888"
---

1\. /opt/test.sh

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

echo "1"&gt;&gt;test.txt

 

//每天早上六点

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

 

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