更新windows定时任务

This commit is contained in:
New Future
2016-11-07 15:29:00 +08:00
parent 5ce835f84b
commit 68a58e94cb
2 changed files with 20 additions and 2 deletions
+12 -1
View File
@@ -35,7 +35,7 @@ python run.py -c /path/to/config.json
* `public`使用公网ip(使用公网API查询)
* `nku` NKU网关ip(只支持ipv4)
## example
### 配置example
```json
{
@@ -53,3 +53,14 @@ python run.py -c /path/to/config.json
"debug": true
}
```
## 定时任务
默认没5分钟检查一次ip变化,自动更新
### windows
**需要已经安装python**
* 以当前用户身份运行定时任务,双击或者运行`task.bat` (执行时会闪黑框)
* 以系统身份运行定时任务,双击或者运行`task.bat` (右键管理员身份运行)
### linux
运行 `sudo ./task.sh`
+8 -1
View File
@@ -6,5 +6,12 @@ REM [/RU username [/RP [password]] /SC schedule [/MO modifier] [/D day]
REM [/M months] [/I idletime] /TN taskname /TR taskrun [/ST starttime]
REM [/RI interval] [ {/ET endtime | /DU duration} [/K]
REM [/XML xmlfile] [/V1]] [/SD startdate] [/ED enddate] [/IT] [/Z] [/F]
schtasks /Create /SC MINUTE /MO 5 /TR "%~dp0run.bat" /TN DDNS
IF %ERRORLEVEL% EQU 0 (
echo run task as SYSTEM
schtasks /Create /SC MINUTE /MO 5 /TR "%~dp0run.bat" /TN "DDNS" /F /RU "SYSTEM"
) ELSE (
echo run task as USER
schtasks /Create /SC MINUTE /MO 5 /TR "%~dp0run.bat" /TN "DDNS" /F
)
PAUSE