python中如何调用scp命令
来源:互联网 发布:程序员试用期个人总结 编辑:程序博客网 时间:2024/05/01 03:18
import statimport pexpect只显示关键代码:sqldb = localpath+database //获取database名字if os.path.exists(sqldb): os.chmod(sqldb,stat.S_IRWXU) //如果database存在,直接改为可读写格式else: //如果不存在,则远程登录服务器去提取 child = pexpect.spawn("scp severA@ip:/path/"+database+" "+localpath) //拷贝到本地目录 child.expect("serverA@ip's password:") child.sendline("password") child.interact() os.chmod(sqldb,stat.S_IRWXU) //把复制到本地的database改为可读写格式
转自:http://blog.chinaunix.net/uid-24497684-id-3287657.html
- python中如何调用scp命令
- Python中如何调用shell命令
- 如何在python中调用linux命令
- Python中如何调用Linux命令
- python中如何调用shell等外部的命令
- [python]如何调用shell命令
- Python 中调用命令行命令
- python中调用dos命令
- Linux中scp命令用法
- linux系统中scp命令
- Windows PowerShell中scp命令
- Linux中scp命令详解
- python中如何调用shell
- python中如何调用shell
- python中如何调用shell
- python中如何调用shell
- Python中调用Ping命令,批量IP
- Java中如何调用DOS命令
- Hive优化实例(一)
- Java JDK7安装与环境变量配置详细图解
- 【Linux基础】Linux目录
- c++builder动态给fastreport的memo、checkbox、picture赋值
- android:padding和android:margin的区别
- python中如何调用scp命令
- 单例模式(C#)
- linux下PostgreSQL安装设置
- NME的GLSL支持情况
- Oracle DB Upgrade & Migrate from Single 11.1.0.7 to Oracle 11.2.0.3 RAC by rconfig
- 模板方法模式Template Methond
- git 分支模型
- 在线流程图设计网站 processon 分析
- 技术抉择 – 为什么我们选择戴尔DRAC企业版?