标签:后台 amp serve 进程 pre log nbsp span auth
#!/usr/bin/python # -*- coding: UTF-8 -*- # @date: 2017/11/27 23:15 # @name: restart_myblog # @author:vickey-wu import os import time def restart(): is_alive = os.system("netstat -anp | grep python") if is_alive: os.system("python /home/myblog/manage.py runserver") if __name__ == ‘__main__‘: while 1: restart() time.sleep(2)
后台运行:nohup python restart_myblog.py &
标签:后台 amp serve 进程 pre log nbsp span auth
原文地址:http://www.cnblogs.com/vickey-wu/p/7906686.html