4-10.15 Linux 中的文件同步传输 --- rsync

2021-09-23  本文已影响0人  捌千里路雲和月
[root@localhost test]# mkdir backups_P
[root@localhost test]# 
[root@localhost test]# tree
.
├── backups_P
└── SRC
    ├── directory
    │   ├── directory4
    │   │   └── demo4.txt
    │   ├── directory5
    │   │   └── demo5.txt
    │   └── file2.txt
    ├── directory1
    │   └── demo1.txt
    ├── directory2
    │   └── demo2.txt
    ├── directory3
    │   └── demo3.txt
    ├── file1.txt
    ├── file3.txt
    ├── file4.txt
    └── office_directory
        ├── docxfile.docx
        ├── elsxfile.elsx
        └── pptxfile.pptx

9 directories, 12 files
[root@localhost test]# 

2、用 rsync -av -P 传输 SRC 目录下 office_directory 目录的文件到 backups_Packages。

##  -P 选项传输时显示进度信息。
[root@localhost test]# rsync -av -P SRC/office_directory/ backups_P/
sending incremental file list
./
docxfile.docx
              0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=2/4)
elsxfile.elsx
              0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=1/4)
pptxfile.pptx
              0 100%    0.00kB/s    0:00:00 (xfr#3, to-chk=0/4)

sent 250 bytes  received 76 bytes  652.00 bytes/sec
total size is 0  speedup is 0.00
[root@localhost test]# 

传输列表内容图解:


传输列表内容图解

3、用 --progress 参数同样也是显示传输进度,效果和 -P 一样。

[root@localhost test]# rsync -av --progress SRC/office_directory/ backups_P/
sending incremental file list
./
docxfile.docx
              0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=2/4)
elsxfile.elsx
              0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=1/4)
pptxfile.pptx
              0 100%    0.00kB/s    0:00:00 (xfr#3, to-chk=0/4)

sent 250 bytes  received 76 bytes  652.00 bytes/sec
total size is 0  speedup is 0.00
[root@localhost test]# 

上一篇下一篇

猜你喜欢

热点阅读