mirror of
https://github.com/NewFuture/DDNS.git
synced 2022-04-19 20:24:44 +00:00
更新windows定时任务
This commit is contained in:
@@ -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`
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user