我想在远程Ubuntu PC(AWS)上运行脚本.
while true; do timeout 1h python worker.py --log-level=ERROR; done
Run Code Online (Sandbox Code Playgroud)
效果很好,但是当我添加nohup:
nohup while true; do timeout 1h python worker.py --log-level=ERROR; done &
Run Code Online (Sandbox Code Playgroud)
它返回错误-bash: syntax error near unexpected token 'do'.
什么是正确的语法?
小智 6
尝试
nohup bash -c 'while true; do timeout 1h python worker.py --log-level=ERROR; done'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2441 次 |
| 最近记录: |