cron调用/bin/sh -c YourCommandHere执行任务。
所以它产生了'/bin/sh. After that shell executes your command, so it startspython/path/to/脚本.py. This command also spawnspython`,它执行脚本。在
-c If the -c option is present, then commands are read from the first non-option argument command_string. If there are arguments after the
command_string, they are assigned to the positional parameters,
starting with $0.
cron
调用/bin/sh -c YourCommandHere
执行任务。所以它产生了'/bin/sh
. After that shell executes your command, so it starts
python/path/to/脚本.py. This command also spawns
python`,它执行脚本。在只要看一下
pstree
,就会看到类似cron -> sh -> python -> python
/bin/bash -c command_string
表示要在shell中执行的命令是从参数command_string
读取的。您可以在bash手册中使用man bash
来阅读它。所以这意味着任务已经执行了。在相关问题 更多 >
编程相关推荐