摘要: 1、复制单个文件 1、把home下的test.yml复制到root目录下 In [43]: import shutil In [42]: shutil.copy('/home/test.yml','/root/') O... 阅读全文
posted @ 2019-01-30 20:47 effortsing 阅读(1505) 评论(0) 推荐(1) 编辑
摘要: 1、用shutil移动文件,import shutil shutil.move('/root/test.yaml','/home/') shutil.move('/root... 阅读全文
posted @ 2019-01-30 20:01 effortsing 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 默认解压到当前目录 import shutil shutil.unpack_archive('/root/redis-3.2.3.tar.gz') 解压到home目录下 import shutil shutil.unpack_archive('/root/redis-3.2.3.tar.gz','/home/') 阅读全文
posted @ 2019-01-30 17:50 effortsing 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 1、准备hosts模板 mkdir -p /k8s/profile cat >/k8s/profile/hosts hostname.py <<EOF #!/usr/bin/python #-*- codinig: UTF-8 -*- from __future__ import print_function import os import shutil import tarfile i... 阅读全文
posted @ 2019-01-30 16:27 effortsing 阅读(647) 评论(0) 推荐(0) 编辑
摘要: ansible加速 试过不管用,反而更慢 cat > /root/.ssh/config <<EOF Host * Compression yes ServerAliveInterval 60 ServerAliveCountMax 5 ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h-%p ControlPersi... 阅读全文
posted @ 2019-01-30 14:54 effortsing 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 查看状态: systemctl status sshd.service 启动服务: systemctl start sshd.service 重启服务: systemctl restart sshd.service 开机自启: systemctl enable sshd.service 阅读全文
posted @ 2019-01-30 13:05 effortsing 阅读(2913) 评论(0) 推荐(0) 编辑