Linux下使用rsync最快速删除海量文件

1、先安装rsync:
yum install rsync
2、建立一个空的文件夹:
mkdir /tmp/test
3、用rsync删除目标目录:
rsync --delete-before -a -H -v --progress --stats /tmp/test log
这样我们要删除的log目录就会被清空了,删除的速度会非常快。

Last modified onSunday, 14 October 2012 04:07

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
Call Stack
#TimeMemoryFunctionLocation
10.0003412288{main}( ).../index.php:0
20.09164270824Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.09164270824Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.337211393032Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.337811417376Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.338411472704Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.338711499672require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.346911896160K2ControllerItem->execute( ).../k2.php:64
90.346911896160K2ControllerItem->display( ).../BaseController.php:710
100.356812540568K2ControllerItem->display( ).../item.php:78
110.356812540568K2ControllerItem->display( ).../controller.php:19
120.360512907624Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.361412927992K2ViewItem->display( ).../ViewController.php:102
140.434915661840K2ViewItem->display( ).../view.html.php:742
150.434915661840K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.437115834144include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701

( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
Call Stack
#TimeMemoryFunctionLocation
10.0003412288{main}( ).../index.php:0
20.09164270824Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.09164270824Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.337211393032Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.337811417376Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.338411472704Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.338711499672require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.346911896160K2ControllerItem->execute( ).../k2.php:64
90.346911896160K2ControllerItem->display( ).../BaseController.php:710
100.356812540568K2ControllerItem->display( ).../item.php:78
110.356812540568K2ControllerItem->display( ).../controller.php:19
120.360512907624Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.361412927992K2ViewItem->display( ).../ViewController.php:102
140.434915661840K2ViewItem->display( ).../view.html.php:742
150.434915661840K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.437115834144include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
back to top