美文网首页
centos自启动python

centos自启动python

作者: 逍遥_yjz | 来源:发表于2021-06-09 09:11 被阅读0次

    一 自定义开机程序

    1.打开文件

    vim /etc/rc.d/rc.local
    

    2.在文件末尾添加启动命令,自启动

    /usr/local/python3.6/bin/python3 /home/test.py > /home/yuhai/log.log 
    

    二 定时启动脚本

      1. 查看
        crontab -l
      1. crontab -e
      1. 设置好定时时间
      1. 设置为每分钟检查一次 // */1 * * * * 脚本目录

    五、重启下机器

    试试:reboot
    以上运行命令,都是绝对路径。

    https://www.cnblogs.com/xiaozao/p/9264037.html
    https://blog.csdn.net/weixin_43279032/article/details/85619969
    https://blog.csdn.net/weiqianglg/article/details/109974714
    https://blog.csdn.net/weixin_40361868/article/details/91347252
    https://blog.csdn.net/weixin_33733810/article/details/89783388

    相关文章

      网友评论

          本文标题:centos自启动python

          本文链接:https://www.haomeiwen.com/subject/lgbjeltx.html