![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python脚本
qq_895043460
从未知到已知。
展开
-
Python sshpass本地传文件到远端及服务重启
脚本使用模块: sshpass 特点:1. 自动指纹校验;2.指定密码和目录传输文件。 # -*- coding: utf8 -*- # /usr/bin/python import subprocess, sys import os, commands afb = "/opt/xdfs-mgnt/mgnt-agent/agent/" alfb = "xdfs-restful/xdfs-mgnt-agent/src/agent/" agent_file = ["hardwares/scsi...原创 2020-07-31 16:22:34 · 518 阅读 · 0 评论 -
使用paramiko 进行多线程本地代码远端打包,及本地打总包
# -*- coding: utf-8 -*- #! /usr/bin/python import paramiko import os import time import threading import commands import sys master_running = True agent_running = True class SSHConnection(object): def __init__(self, host_dict): self.host = .原创 2020-07-11 16:02:43 · 201 阅读 · 0 评论 -
本地上传代码到远端覆盖,并重启服务
# -*- coding: utf8 -*- # /usr/bin/python import subprocess, sys import os, commands afb = "/opt/xdfs-mgnt/mgnt-agent/agent/" alfb = "xdfs-restful-xfile/xdfs-mgnt-agent/src/agent/" agent_file = ["hardwares/scsi.py", "xfile.py", "hardwares/nvmeof.py", "har.原创 2020-07-11 16:00:28 · 215 阅读 · 0 评论