Quickly delete large files and lots of small files.

Source: Internet
Author: User
Tags rsync

Can be used to empty directories or files, as follows:  1, first set up an empty directory   mkdir/data/blank  2, remove the target directory with rsync   rsync--delete-before-d/data/ blank//var/spool/clientmqueue/  so the target directory is quickly emptied     If you have some very large files to delete, For example, nohup.out such as real-time update of the file, at every turn dozens of g on hundreds of G, can also   www.cit.cn     to use rsync to empty large files, and high efficiency   1, create an empty file   touch /data/blank.txt  2, use rsync to empty files   rsync-a--delete-before--progress--stats/root/blank.txt/root/nohup.out& nbsp Building file list ...  1 file to consider  blank.txt             0 100% &nbs P  0.00kb/s    0:00:00 (xfer#1, TO-CHECK=0/1)     Number of files:1  number of files Transferr ed:1  Total File size:0 bytes  Total transferred file size:0 bytes  Literal data:0 bytes  matched data:0 bytes  File list size:27  file list generation time:0.006 seconds  file list transfer time:0.000 seconds  Total Bytes sent:73  Total bytes received:31    www.cit.cn   Sent bytes  received bytes  208.00 bytes/sec  total size is 0  speedup is 0.00    tips:  error when SRC and dest files are inconsistent   when SRC and dest properties are file "F", it means emptying the contents of the file instead of deleting the file   When the SRC and Dest properties are both directory "D", it means to delete all files under the directory and make them empty   most importantly, it is handled fairly quickly, processing a few G files that is the second level   the core content is: Rsync actually uses the replacement principle

The

quickly deletes large files and a large number of small files.

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.