Linux下python脚本自启动和定时启动
一、服务器开机自动运行
- 用root权限编辑以下文件 sudo vim /etc/rc.local
- 编辑启动脚本的命令地址 /usr/bin/python3 /path/to/python > /path/to/log
二、定时启动
- 编辑crontab文件 crontab -e
- 编辑命令 */30 * * * * /usr/bin/python3 /path/to/python >> /path/to/log 2>&1
一、服务器开机自动运行
二、定时启动
