Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复windows下定时任务重定向失败的BUG #414

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

LeadroyaL
Copy link
Contributor

BUG自 339e58b 引入

schtasks 的 /TR "%RUNCMD%"里,RUNCMD是 executable arg0 arg1的格式,无法处理重定向符,executable arg0 arg1 >> output.txt,不会在文件末尾追加标准输出,疑似将 ">>" 视为了入参。

且此处疑似存在由 ">>" 引起的转义问题,对commit进行回滚,消除BUG。

@LeadroyaL LeadroyaL changed the title 修复windows下定时任务输出 修复windows下定时任务重定向失败的BUG Dec 31, 2023
@LeadroyaL
Copy link
Contributor Author

流水线检查过不去我也没办法,不是我引起的

@NewFuture
Copy link
Owner

我晚点看看

@NewFuture
Copy link
Owner

第4行 去掉 >>
第10改成 /TR "%RUNCMD% >> %LOGFILE%"
是否可行

这样不用再依赖另一个bat文件

@LeadroyaL
Copy link
Contributor Author

第4行 去掉 >> 第10改成 /TR "%RUNCMD% >> %LOGFILE%" 是否可行

这样不用再依赖另一个bat文件

这样是不行的,问题在于 /TR 后面的命令, "%RUNCMD% >> %LOGFILE%" 这个管道符不是作为管道符存在,而是作为 %RUNCMD% 的第1个入参存在,必须依赖另一个bat

@LeadroyaL
Copy link
Contributor Author

@NewFuture

@NewFuture NewFuture merged commit 863c8f0 into NewFuture:master Feb 14, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants