- 01 在想要运行的文件路径下新建sh脚本文件
vim auto.sh
# 按a进入insert模式 写入
# 英文半角状态下 按 ':' 进入末尾模式 'wq'代表保存更改并推出
- 02 写入以下脚本语句
#!/bin/bash
python -u 文件名.py
- 03 执行脚本
将日志存入auto.log中
./auto.sh > auto.log &
- 04 查看执行情况
ps -e
vim auto.sh
# 按a进入insert模式 写入
# 英文半角状态下 按 ':' 进入末尾模式 'wq'代表保存更改并推出
#!/bin/bash
python -u 文件名.py
./auto.sh > auto.log &
ps -e