正文
找到python脚本文件,比如
/root/web.py
设置777权限
sudo chmod 777 /root/web.py
启动目录创建一个web.sh执行python文件
vim /etc/init.d/web.sh
nohup python3 /root/web.py >/dev/null 2>&1 &
设置sh权限
sudo chmod +x /etc/init.d/web.sh
修改/etc/rc.local在exit前加入
sudo bash /etc/init.d/web.sh
测试执行sh
sudo /etc/init.d/web.sh
重启reboot测试有没成功
- 上一篇: python脚本检测出现指定标题窗口并点击鼠标
- 下一篇: 常见搜索引擎蜘蛛UserAgent
猜你喜欢
- 2024-01-02Centos8安装Python3.9
- 搜索