Measure the test taker's knowledge about how to delete massive data files in seconds during O & M.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.