This article is No. 9 in the O & M of chinamoocs. It is too slow to update ,,
In O & M, sometimes we need to delete large files, or n (n is infinite ~~) Multiple small files
So, RM,
Here, rocky introduces the most cute, gentle, mature, kind and kind of Linux in history.
This is another method of rsync.
① Syntax:
# Rsync -- delete-before-AVH -- Progress -- stats DEST SRC
Explanation:
When SRC and DEST are both objects [f], this indicates clearing the object content rather than deleting the object.
When SRC and DEST are both directories [d], it means to delete all files in the directory and change it to an empty directory.
PS: Actually, this command is very memorable,AV-_-#,H$ _ $, A man rarely understands, cool, who is on your hard disk at this time ,,
② Principle:
Rsync actually uses the replacement principle
③ Advantages:
Processing speed is quite fast. Processing Several GB of files is a matter of seconds, which is much faster than RM.
④ Disadvantages:
High Disk Io usage, business peaks, or temporary avoidance
⑤ Test:
[root@localhost log]# lsrhel-server-5.8-i386-dvd.iso[root@localhost log]# pwd/tmp/test/log[root@localhost ~]# mkdir empty[root@localhost ~]# rsync --delete-before -avH --progress --stats /root/empty/ /tmp/test/log/building file list ... 1 file to considerdeleting rhel-server-5.8-i386-dvd.iso./Number of files: 1Number of files transferred: 0Total file size: 0 bytesTotal transferred file size: 0 bytesLiteral data: 0 bytesMatched data: 0 bytesFile list size: 19File list generation time: 0.001 secondsFile list transfer time: 0.000 secondsTotal bytes sent: 29Total bytes received: 15sent 29 bytes received 15 bytes 6.77 bytes/sectotal size is 0 speedup is 0.00