From 339e58b6121ef52cc5134a576b0a680ec2a1142a Mon Sep 17 00:00:00 2001 From: New Future Date: Sun, 29 Jul 2018 13:46:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E8=84=9A=E6=9C=AC=E5=92=8C?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.sh | 3 --- task.bat | 2 +- task.sh | 5 ++++- 3 files changed, 5 insertions(+), 5 deletions(-) delete mode 100755 run.sh diff --git a/run.sh b/run.sh deleted file mode 100755 index 0231276..0000000 --- a/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -RUN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; -"$RUN_DIR/run.py" -c "$RUN_DIR/config.json" >> "$RUN_DIR/run.log" \ No newline at end of file diff --git a/task.bat b/task.bat index fae7518..e2c9ac1 100644 --- a/task.bat +++ b/task.bat @@ -1,7 +1,7 @@ @ECHO OFF REM https://msdn.microsoft.com/zh-cn/library/windows/desktop/bb736357(v=vs.85).aspx -SET RUNCMD="%~dp0run.bat" "%~dp0run.log" +SET RUNCMD=python "%~dp0run.py" -c "%~dp0config.json" >> "%~dp0run.log" SET RUN_USER=%USERNAME% WHOAMI /GROUPS | FIND "12288" > NUL && SET RUN_USER="SYSTEM" diff --git a/task.sh b/task.sh index cef02af..82965f2 100755 --- a/task.sh +++ b/task.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash RUN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; -echo "*/5 * * * * root ${RUN_DIR}/run.sh" > /etc/cron.d/ddns; + +CMD="'$RUN_DIR/run.py' -c '$RUN_DIR/config.json' >> '$RUN_DIR/run.log'" + +echo "*/5 * * * * root '$CMD'" > /etc/cron.d/ddns; /etc/init.d/cron reload;