当前位置: 首页 > news >正文

系统间复制文档

windows和Linux之间传输

xftp工具

  • 直接拉取

xshell

  • Linux服务器安装 lrzsz 软件包。该方式传输速度比ftp慢。

#安装iotop[root@server ~ 16:01:10]# yum install -y iotop#iotop查看下载用户/传输等[root@server ~ 16:01:10]# iotopTotal DISK READ :   0.00 B/s | Total DISK WRITE :      91.59 M/sActual DISK READ:   0.00 B/s | Actual DISK WRITE:     264.54 M/sTID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND         8408 be/4 root        0.00 B/s    0.00 B/s  0.00 %  4.14 % [kworker/u256:2]8596 be/4 root        0.00 B/s   47.48 M/s  0.00 %  0.00 % sftp-server8605 be/4 root        0.00 B/s   44.12 M/s  0.00 %  0.00 % sftp-server1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % systemd -~ialize 222 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]​

Linux之间传输

scp命令

  • scp 命令缺点:不管目的位置是否有文件,总是再复制一次,可以理解为全量备份。缺少比对功能。

#client复制server的文件过来[root@client ~ 16:32:32]# scp root@server:/root/etc.tar.bz2 .root@server's password: etc.tar.bz2                                   100%   10MB  77.3MB/s   00:00    [root@client ~ 16:33:09]# ls etc*etc.tar.bz2# 复制多个文件[root@client ~ 16:37:55]# scp root@server:/root/{etc.tar.gz,etc.tar.xz}  .root@server's password: etc.tar.gz                                    100%   12MB  76.6MB/s   00:00 root@server's password: etc.tar.xz                                    100% 8485KB  88.5MB/s   00:00  #复制目录不加-r报错[root@client ~ 16:39:36]# scp root@server:/etc/eeedir/  .root@server's password: scp: /etc/eeedir: not a regular file​# 复制目录,使用 -r 选项[root@client ~ 16:41:10]# scp -r root@server:/etc/eeedir/  .root@server's password: 1.txt                                         100%    0     0.0KB/s   00:00    2.txt                                         100%    0     0.0KB/s   00:00   ​# 上传,如果路径没有写,表示相对用户家目录。这里是上传到root用户家目录/root,root@server加上冒号:[root@client ~ 16:42:48]# scp etc.tar.bz2 root@server:root@server's password: etc.tar.bz2                                   100%   10MB 108.4MB/s   00:00   

rsync命令

  • Rsync具有本地与远程两台主机之间的数据快速复制同步镜像、远程备份等功能,该功能类似scp,但是优于scp功能,还具有本地不同分区目录之间全量及增量复制数据。

  • Rsync同步数据镜像时,通过“quick check”算法,仅同步大小或最后修改时间发生变化的文件或目录,当然也可以根据权限,属主等属性变化的同步,所以可以实现快速同步。

  • 前提:客户端和服务端都要提前安装好 rsync 软件包。

# 准备文件[root@client ~ 17:01:01]# mkdir Pictures[root@client ~ 17:01:07]# touch Pictures/snap{1..5}.jpg# 首次同步[root@client ~ 17:01:13]# rsync -av Pictures root@server:root@server's password: sending incremental file listPictures/Pictures/snap1.jpgPictures/snap2.jpgPictures/snap3.jpgPictures/snap4.jpgPictures/snap5.jpg​sent 351 bytes  received 115 bytes  84.73 bytes/sectotal size is 0  speedup is 0.00# 再次同步[root@client ~ 17:01:26]# rsync -av Pictures root@server:root@server's password: sending incremental file list​sent 153 bytes  received 17 bytes  68.00 bytes/sectotal size is 0  speedup is 0.00​# 更新部分文件时间戳,再同步[root@client ~ 17:01:36]# touch Pictures/snap{1,2}*[root@client ~ 17:03:00]# rsync -av Pictures root@server:root@server's password: sending incremental file listPictures/snap1.jpgPictures/snap2.jpg​sent 239 bytes  received 55 bytes  84.00 bytes/sectotal size is 0  speedup is 0.00​# 删除 SRC 中文件,默认不会同步删除DEST中文件[root@client ~ 17:03:07]#  rm -f Pictures/snap5.jpg[root@client ~ 17:03:59]# rsync -av Pictures root@server:root@server's password: sending incremental file listPictures/​sent 147 bytes  received 20 bytes  66.80 bytes/sectotal size is 0  speedup is 0.00​# 使用选项 --delete 同步删除 DEST 中文件[root@client ~ 17:04:05]# rsync -av Pictures root@server: --deleteroot@server's password: sending incremental file listdeleting Pictures/snap5.jpg​sent 144 bytes  received 39 bytes  73.20 bytes/sectotal size is 0  speedup is 0.00
http://www.lryc.cn/news/603486.html

相关文章:

  • 论文阅读--射频电源在半导体领域的应用
  • React--》实现 PDF 文件的预览操作
  • 配置daemon.json使得 Docker 容器能够使用服务器GPU【验证成功】
  • VitePress学习笔记
  • 彻底清理ArcGIS 10.2残留的步骤
  • Windows使用Powershell自动安装SqlServer2025服务器与SSMS管理工具
  • Vue.js 完全指南:从入门到精通
  • getgff.py脚本-python006
  • openbmc 阈值sensor分析
  • 计算机视觉(CV方向)算法基础
  • SketchUp纹理贴图插件Architextures安装使用图文教程
  • Linux sshfs 安全挂载远程文件系统 命令详解
  • Angular面试题目和答案大全
  • AR辅助前端设计:虚实融合场景下的设备维修指引界面开发实践
  • Mac m系列芯片安装node14版本使用nvm + Rosetta 2
  • YotoR模型:Transformer与YOLO新结合,打造“又快又准”的目标检测模型
  • VUE -- 基础知识讲解(一)
  • 【MySQL】数据库的简单介绍
  • Node.js 内置模块
  • 安卓模拟器 adb Frida hook 抓包
  • uniapp如何封装uni.request 全局使用
  • 自适应双门限的能量检测算法
  • 2025年中科院1区SCI-冬虫夏草优化算法Caterpillar Fungus Optimizer-附Matlab免费代码
  • 09 RK3568 Debian11 ES8388 模拟音频输出
  • 电磁兼容(EMC):整改案例(十三)屏蔽外壳开孔解决433MHz无线通信问题
  • vue3+vite 使用liveplayer加载视频
  • 【学习路线】游戏开发大师之路:从编程基础到独立游戏制作
  • BehaviorTree.Ros2 编译教程
  • java导入pdf(携带动态表格,图片,纯java不需要模板)
  • 前端基础之《Vue(26)—Vue3两种语法范式》