当前位置:首页>python>Python运维工程师必会的指令

Python运维工程师必会的指令

  • 2026-06-30 12:43:09
Python运维工程师必会的指令

Python运维工程师必会的指令

掌握这些Python运维指令,让你的运维工作自动化、高效化

欢迎大家关注此公众号,后台点击按钮【免费资料】可免费获取【Python入门30节课】电子书

  1. 此外小庄推荐一本适合于新手\小白入手一本 Python基础书籍,欢迎大家订阅,也感谢大家支持,我才有更新的动力

前言

Python运维工程师需要掌握一系列用于系统管理、自动化部署、监控告警的指令和工具。本文将系统性地介绍运维工程师必须掌握的Python指令,帮助你构建强大的运维自动化体系。


一、系统信息获取

1.1 获取系统信息

import platform

print(platform.system())       # 操作系统: Windows/Linux/Darwin
print(platform.release())      # 系统版本
print(platform.version())      # 系统详细版本
print(platform.machine())      # 机器架构: x86_64/AMD64
print(platform.processor())    # 处理器信息
print(platform.node())         # 主机名

1.2 获取CPU信息

import psutil

# CPU使用率
cpu_percent = psutil.cpu_percent(interval=1)
print(f'CPU使用率: {cpu_percent}%')

# 每个CPU核心的使用率
cpu_per_core = psutil.cpu_percent(interval=1, percpu=True)
for i, percent in enumerate(cpu_per_core):
print(f'CPU核心{i}{percent}%')

# CPU数量
print(f'逻辑CPU: {psutil.cpu_count()}')
print(f'物理CPU: {psutil.cpu_count(logical=False)}')

# CPU频率
cpu_freq = psutil.cpu_freq()
print(f'当前频率: {cpu_freq.current}MHz')

1.3 获取内存信息

import psutil

memory = psutil.virtual_memory()
print(f'总内存: {memory.total / 1024 / 1024 / 1024:.2f}GB')
print(f'已使用: {memory.used / 1024 / 1024 / 1024:.2f}GB')
print(f'可用内存: {memory.available / 1024 / 1024 / 1024:.2f}GB')
print(f'使用率: {memory.percent}%')

# 交换内存
swap = psutil.swap_memory()
print(f'交换内存使用率: {swap.percent}%')

1.4 获取磁盘信息

import psutil

# 磁盘分区
partitions = psutil.disk_partitions()
for partition in partitions:
print(f'设备: {partition.device}, 挂载点: {partition.mountpoint}')

    usage = psutil.disk_usage(partition.mountpoint)
print(f'  总空间: {usage.total / 1024 / 1024 / 1024:.2f}GB')
print(f'  已使用: {usage.used / 1024 / 1024 / 1024:.2f}GB')
print(f'  使用率: {usage.percent}%')

# 磁盘IO
disk_io = psutil.disk_io_counters()
print(f'读取字节数: {disk_io.read_bytes}')
print(f'写入字节数: {disk_io.write_bytes}')

1.5 获取网络信息

import psutil

# 网络接口
net_interfaces = psutil.net_if_addrs()
for name, addrs in net_interfaces.items():
print(f'接口: {name}')
for addr in addrs:
if addr.family.name == 'AF_INET':
print(f'  IPv4: {addr.address}')

# 网络IO
net_io = psutil.net_io_counters()
print(f'发送字节数: {net_io.bytes_sent}')
print(f'接收字节数: {net_io.bytes_recv}')

# 网络连接
connections = psutil.net_connections()
for conn in connections[:5]:
print(f'本地地址: {conn.laddr}, 远程地址: {conn.raddr}, 状态: {conn.status}')

二、进程管理

2.1 查看所有进程

import psutil

for proc in psutil.process_iter(['pid''name''cpu_percent''memory_percent']):
print(f"PID: {proc.info['pid']}, 名称: {proc.info['name']}, "
f"CPU: {proc.info['cpu_percent']}%, 内存: {proc.info['memory_percent']:.2f}%")

2.2 查找特定进程

import psutil

def find_process_by_name(name):
"""根据进程名查找进程"""
    processes = []
for proc in psutil.process_iter(['pid''name''cmdline']):
if name.lower() in proc.info['name'].lower():
            processes.append(proc)
return processes

# 查找Python进程
python_procs = find_process_by_name('python')
for proc in python_procs:
print(f"PID: {proc.pid}, 命令: {proc.cmdline()}")

2.3 进程操作

import psutil
import os

# 获取当前进程
current_proc = psutil.Process(os.getpid())
print(f'当前进程PID: {current_proc.pid}')
print(f'进程名称: {current_proc.name()}')
print(f'进程状态: {current_proc.status()}')

# 终止进程
proc = psutil.Process(1234)
proc.terminate()  # 发送SIGTERM
# proc.kill()     # 发送SIGKILL

# 等待进程结束
proc.wait(timeout=10)

2.4 获取进程详细信息

import psutil

proc = psutil.Process(1234)

# 基本信息
print(f'PID: {proc.pid}')
print(f'名称: {proc.name()}')
print(f'状态: {proc.status()}')
print(f'创建时间: {proc.create_time()}')

# 资源使用
print(f'CPU使用率: {proc.cpu_percent(interval=1)}%')
print(f'内存使用: {proc.memory_info().rss / 1024 / 1024:.2f}MB')
print(f'内存使用率: {proc.memory_percent():.2f}%')

# 命令行
print(f'命令行: {proc.cmdline()}')

# 工作目录
print(f'工作目录: {proc.cwd()}')

# 打开的文件
for file in proc.open_files():
print(f'打开文件: {file.path}')

三、文件系统操作

3.1 文件和目录操作

import os
import shutil
import glob

# 获取当前目录
current_dir = os.getcwd()
print(f'当前目录: {current_dir}')

# 列出目录内容
files = os.listdir('.')
for file in files:
print(file)

# 判断路径
print(os.path.exists('/path/to/file'))
print(os.path.isfile('/path/to/file'))
print(os.path.isdir('/path/to/dir'))

# 获取文件信息
file_path = 'test.txt'
print(f'文件大小: {os.path.getsize(file_path)}字节')
print(f'修改时间: {os.path.getmtime(file_path)}')

# 创建目录
os.makedirs('/path/to/dir', exist_ok=True)

# 删除目录
shutil.rmtree('/path/to/dir')

# 复制文件
shutil.copy('source.txt''destination.txt')
shutil.copytree('source_dir''destination_dir')

# 移动/重命名
shutil.move('old_name.txt''new_name.txt')

# 删除文件
os.remove('file.txt')

# 查找文件
files = glob.glob('*.py')
files = glob.glob('**/*.py', recursive=True)

3.2 文件内容操作

# 读取文件
with open('file.txt''r', encoding='utf-8'as f:
    content = f.read()

# 逐行读取
with open('file.txt''r', encoding='utf-8'as f:
for line in f:
print(line.strip())

# 写入文件
with open('output.txt''w', encoding='utf-8'as f:
    f.write('Hello World\n')

# 追加写入
with open('log.txt''a', encoding='utf-8'as f:
    f.write('New log entry\n')

3.3 文件监控

import os
import time

def watch_file(file_path, interval=1):
"""监控文件变化"""
    last_mtime = os.path.getmtime(file_path)

while True:
        current_mtime = os.path.getmtime(file_path)
if current_mtime != last_mtime:
print(f'文件 {file_path} 已更新')
            last_mtime = current_mtime
        time.sleep(interval)

# 使用watchdog库进行更强大的文件监控
# pip install watchdog
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

class MyHandler(FileSystemEventHandler):
def on_modified(self, event):
print(f'文件已修改: {event.src_path}')

def on_created(self, event):
print(f'文件已创建: {event.src_path}')

def on_deleted(self, event):
print(f'文件已删除: {event.src_path}')

observer = Observer()
observer.schedule(MyHandler(), path='.', recursive=True)
observer.start()

四、Shell命令执行

4.1 使用subprocess执行命令

import subprocess

# 执行简单命令
result = subprocess.run(['ls''-la'], capture_output=True, text=True)
print(result.stdout)
print(result.stderr)
print(result.returncode)

# 执行shell命令
result = subprocess.run('ls -la | grep .py', shell=True, capture_output=True, text=True)

# 超时控制
try:
    result = subprocess.run(['ping''-c''4''google.com'], 
                          capture_output=True, text=True, timeout=10)
except subprocess.TimeoutExpired:
print('命令执行超时')

4.2 使用subprocess.Popen

import subprocess

# 启动进程
process = subprocess.Popen(['ping''-c''4''google.com'],
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE,
                          text=True)

# 获取输出
stdout, stderr = process.communicate()
print(f'输出: {stdout}')
print(f'错误: {stderr}')
print(f'返回码: {process.returncode}')

4.3 使用os.system

import os

# 简单执行命令
os.system('ls -la')

# 获取命令输出(使用popen)
output = os.popen('ls -la').read()
print(output)

4.4 使用paramiko进行SSH

import paramiko

# 创建SSH客户端
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

# 连接服务器
ssh.connect('hostname', username='user', password='password')

# 执行命令
stdin, stdout, stderr = ssh.exec_command('ls -la')
print(stdout.read().decode())

# 使用密钥连接
private_key = paramiko.RSAKey.from_private_key_file('/path/to/key')
ssh.connect('hostname', username='user', pkey=private_key)

# 关闭连接
ssh.close()

五、日志管理

5.1 使用logging模块

import logging

# 配置日志
logging.basicConfig(
    level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    handlers=[
        logging.FileHandler('app.log'),
        logging.StreamHandler()
    ]
)

logger = logging.getLogger(__name__)

# 记录日志
logger.info('这是一条信息日志')
logger.warning('这是一条警告日志')
logger.error('这是一条错误日志')
logger.debug('这是一条调试日志')

5.2 日志轮转

import logging
from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler

# 按大小轮转
handler = RotatingFileHandler(
'app.log'
    maxBytes=10*1024*1024,  # 10MB
    backupCount=5
)

# 按时间轮转
handler = TimedRotatingFileHandler(
'app.log',
    when='midnight',
    interval=1,
    backupCount=30
)

5.3 解析日志文件

import re
from collections import Counter

def parse_nginx_log(log_file):
"""解析Nginx日志"""
    ip_pattern = r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'

    ip_list = []
with open(log_file, 'r'as f:
for line in f:
match = re.search(ip_pattern, line)
if match:
                ip_list.append(match.group())

# 统计IP访问次数
    ip_counter = Counter(ip_list)
return ip_counter.most_common(10)

六、定时任务

6.1 使用schedule库

import schedule
import time

def job():
print("执行定时任务...")

# 每隔10分钟执行
schedule.every(10).minutes.do(job)

# 每小时执行
schedule.every().hour.do(job)

# 每天10:30执行
schedule.every().day.at("10:30").do(job)

# 每周一执行
schedule.every().monday.do(job)

# 运行定时任务
while True:
    schedule.run_pending()
    time.sleep(1)

6.2 使用APScheduler

from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.triggers.cron import CronTrigger
from apscheduler.triggers.interval import IntervalTrigger

scheduler = BlockingScheduler()

# 间隔执行
@scheduler.scheduled_job(IntervalTrigger(seconds=30))
def interval_job():
print("每30秒执行一次")

# Cron表达式
@scheduler.scheduled_job(CronTrigger(hour=8, minute=30))
def cron_job():
print("每天8:30执行")

scheduler.start()

6.3 使用crontab

# 生成crontab配置
def generate_crontab(command, schedule):
"""生成crontab配置"""
return f"{schedule} {command}"

# 示例:每天凌晨2点执行备份
crontab = generate_crontab(
    command="/usr/bin/python3 /path/to/backup.py",
    schedule="0 2 * * *"
)
print(crontab)

七、网络监控

7.1 Ping检测

import subprocess
import platform

def ping(host, count=4):
"""Ping主机"""
    param = '-n' if platform.system().lower() == 'windows' else '-c'
    command = ['ping', param, str(count), host]

try:
        result = subprocess.run(command, capture_output=True, text=True, timeout=10)
return result.returncode == 0
except subprocess.TimeoutExpired:
return False

# 批量检测
hosts = ['google.com''github.com''example.com']
for host in hosts:
    status = '在线' if ping(host) else '离线'
print(f'{host}{status}')

7.2 端口检测

import socket

def check_port(host, port, timeout=2):
"""检测端口是否开放"""
try:
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.settimeout(timeout)
        result = sock.connect_ex((host, port))
        sock.close()
return result == 0
except socket.error:
return False

# 检测常用端口
ports = [228044333066379]
for port in ports:
    status = '开放' if check_port('localhost', port) else '关闭'
print(f'端口 {port}{status}')

7.3 HTTP健康检查

import requests
from datetime import datetime

def health_check(url, timeout=5):
"""HTTP健康检查"""
try:
        start_time = datetime.now()
        response = requests.get(url, timeout=timeout)
        end_time = datetime.now()

        response_time = (end_time - start_time).total_seconds()

return {
'url': url,
'status': response.status_code,
'response_time': response_time,
'healthy': response.status_code == 200
        }
except requests.RequestException as e:
return {
'url': url,
'status'None,
'response_time'None,
'healthy'False,
'error'str(e)
        }

# 批量健康检查
urls = [
'https://www.google.com',
'https://www.github.com',
'https://api.example.com'
]

for url in urls:
    result = health_check(url)
    status = '健康' if result['healthy'else '异常'
print(f"{url}{status}")

八、配置管理

8.1 使用YAML配置

import yaml

# 读取YAML配置
with open('config.yaml''r', encoding='utf-8'as f:
    config = yaml.safe_load(f)

print(config['database']['host'])
print(config['database']['port'])

# 写入YAML配置
config = {
'database': {
'host''localhost',
'port'3306,
'name''mydb'
    },
'server': {
'host''0.0.0.0',
'port'8080
    }
}

with open('config.yaml''w', encoding='utf-8'as f:
    yaml.dump(config, f, default_flow_style=False)

8.2 使用JSON配置

import json

# 读取JSON配置
with open('config.json''r', encoding='utf-8'as f:
    config = json.load(f)

# 写入JSON配置
with open('config.json''w', encoding='utf-8'as f:
    json.dump(config, f, indent=2, ensure_ascii=False)

8.3 使用环境变量

import os

# 读取环境变量
db_host = os.environ.get('DB_HOST''localhost')
db_port = int(os.environ.get('DB_PORT'3306))

# 设置环境变量
os.environ['MY_VAR'] = 'my_value'

8.4 使用python-dotenv

from dotenv import load_dotenv
import os

# 加载.env文件
load_dotenv()

# 读取环境变量
secret_key = os.getenv('SECRET_KEY')
database_url = os.getenv('DATABASE_URL')

九、备份与恢复

9.1 文件备份

import shutil
import os
from datetime import datetime

def backup_file(source, backup_dir):
"""备份文件"""
if not os.path.exists(backup_dir):
        os.makedirs(backup_dir)

    timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
    filename = os.path.basename(source)
    backup_path = os.path.join(backup_dir, f'{filename}.{timestamp}.bak')

    shutil.copy2(source, backup_path)
return backup_path

# 使用示例
backup_path = backup_file('important.db''./backups')
print(f'备份已创建: {backup_path}')

9.2 数据库备份

import subprocess
from datetime import datetime

def backup_mysql(host, user, password, database, backup_dir):
"""MySQL数据库备份"""
    timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
    backup_file = f'{backup_dir}/{database}_{timestamp}.sql'

    command = [
'mysqldump',
f'--host={host}',
f'--user={user}',
f'--password={password}',
        database
    ]

with open(backup_file, 'w'as f:
        subprocess.run(command, stdout=f, check=True)

return backup_file

# 使用示例
backup_file = backup_mysql('localhost''root''password''mydb''./backups')
print(f'数据库备份完成: {backup_file}')

9.3 自动清理旧备份

import os
import glob
from datetime import datetime, timedelta

def cleanup_old_backups(backup_dir, days=7):
"""清理超过指定天数的备份文件"""
    cutoff_date = datetime.now() - timedelta(days=days)

for file_path in glob.glob(os.path.join(backup_dir, '*.bak')):
        file_stat = os.stat(file_path)
        file_mtime = datetime.fromtimestamp(file_stat.st_mtime)

if file_mtime < cutoff_date:
            os.remove(file_path)
print(f'已删除旧备份: {file_path}')

# 使用示例
cleanup_old_backups('./backups', days=7)

十、监控告警

10.1 系统监控脚本

import psutil
import smtplib
from email.mime.text import MIMEText
from datetime import datetime

def system_monitor():
"""系统监控"""
    alerts = []

# CPU监控
    cpu_percent = psutil.cpu_percent(interval=1)
if cpu_percent > 90:
        alerts.append(f'CPU使用率过高: {cpu_percent}%')

# 内存监控
    memory = psutil.virtual_memory()
if memory.percent > 90:
        alerts.append(f'内存使用率过高: {memory.percent}%')

# 磁盘监控
    disk = psutil.disk_usage('/')
if disk.percent > 90:
        alerts.append(f'磁盘使用率过高: {disk.percent}%')

return alerts

def send_alert_email(alerts, to_email):
"""发送告警邮件"""
if not alerts:
return

    subject = f'系统告警 - {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}'
    body = '\n'.join(alerts)

    msg = MIMEText(body)
    msg['Subject'] = subject
    msg['From'] = 'monitor@example.com'
    msg['To'] = to_email

with smtplib.SMTP('smtp.example.com'587as server:
        server.starttls()
        server.login('user''password')
        server.send_message(msg)

# 执行监控
alerts = system_monitor()
if alerts:
    send_alert_email(alerts, 'admin@example.com')

10.2 钉钉/企业微信告警

import requests
import json

def send_dingtalk_alert(webhook, message):
"""发送钉钉告警"""
    headers = {'Content-Type''application/json'}
    data = {
'msgtype''text',
'text': {
'content': message
        }
    }
    response = requests.post(webhook, headers=headers, data=json.dumps(data))
return response.json()

def send_wechat_alert(webhook, message):
"""发送企业微信告警"""
    headers = {'Content-Type''application/json'}
    data = {
'msgtype''text',
'text': {
'content': message
        }
    }
    response = requests.post(webhook, headers=headers, data=json.dumps(data))
return response.json()

# 使用示例
dingtalk_webhook = 'https://oapi.dingtalk.com/robot/send?access_token=xxx'
send_dingtalk_alert(dingtalk_webhook, '服务器CPU使用率超过90%!')

总结

作为Python运维工程师,掌握这些指令是必备技能:

  1. 系统信息获取 - psutil库的强大功能
  2. 进程管理 - 监控和管理进程
  3. 文件操作 - 文件和目录管理
  4. Shell命令执行 - subprocess和paramiko
  5. 日志管理 - 日志记录和分析
  6. 定时任务 - 自动化执行
  7. 网络监控 - 服务健康检查
  8. 配置管理 - YAML/JSON/环境变量
  9. 备份恢复 - 数据安全保障
  10. 监控告警 - 及时发现问题

掌握这些工具,你就能构建强大的运维自动化体系。


关注我,获取更多Python技术干货!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 06:25:04 HTTP/2.0 GET : https://f.mffb.com.cn/a/499491.html
  2. 运行时间 : 0.174880s [ 吞吐率:5.72req/s ] 内存消耗:4,969.96kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=313fa5f8305abed902ffcd0eb2a23608
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000413s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000569s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000286s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000288s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000526s ]
  6. SELECT * FROM `set` [ RunTime:0.006934s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000710s ]
  8. SELECT * FROM `article` WHERE `id` = 499491 LIMIT 1 [ RunTime:0.003645s ]
  9. UPDATE `article` SET `lasttime` = 1783031104 WHERE `id` = 499491 [ RunTime:0.002646s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000309s ]
  11. SELECT * FROM `article` WHERE `id` < 499491 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.007788s ]
  12. SELECT * FROM `article` WHERE `id` > 499491 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002242s ]
  13. SELECT * FROM `article` WHERE `id` < 499491 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.067361s ]
  14. SELECT * FROM `article` WHERE `id` < 499491 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001402s ]
  15. SELECT * FROM `article` WHERE `id` < 499491 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.013335s ]
0.176393s