美文网首页Linux
Ubuntu和Debian8开机运行某个py脚本

Ubuntu和Debian8开机运行某个py脚本

作者: 吾星喵 | 来源:发表于2018-04-14 15:31 被阅读36次

编辑/etc/rc.local

duoyi@duoyi-IT-Server:/etc/samba$ sudo vim.tiny /etc/rc.local 
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/usr/bin/python3 /home/duoyi/ServerStatus/ServerStatus.py &

exit 0

只需要在后面加上 /usr/bin/python3 /home/duoyi/ServerStatus/ServerStatus.py & 即可,最后这个&字符表示后台启动

相关文章

网友评论

    本文标题:Ubuntu和Debian8开机运行某个py脚本

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