LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-24-2009, 02:56 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
faster way to move old file


I have thousands files in a path , I tried to use command "find" to move the old file (elder than 150 days) to another path , but it takes 1 day but only move 15% of these files , and the server also become very slow .


the command

find . -mtime +150 -exec mv {} path \;


If I use these way to move files , I think I need 3-4 days more , can advise what is the faster way to move file ? thx
 
Old 06-24-2009, 08:37 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
As I understand it -exec will execute the command separately for each of the files matched. You can make it more efficient by piping the list into xargs instead, which will run them all in a single process.

I'm not sure how much of a difference that will make, or how well it can handle such a large load though.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
squirrel Could not move/copy file. File not attached mrlinux2000 Linux - Software 4 05-24-2010 04:41 AM
LXer: Linux 2.6.30 Gets Faster Boot - but is Fedora Faster? LXer Syndicated Linux News 0 06-11-2009 05:40 AM
LXer: Firefox 3.5 Speed Freak: Faster Development, Faster Performance LXer Syndicated Linux News 0 06-10-2009 03:42 AM
move (mv) files faster noir911 Linux - General 6 06-29-2008 12:48 PM
LXer: Firefox 3 Beta 4 is 5x faster than IE7, 3x faster than FF2 LXer Syndicated Linux News 0 03-12-2008 06:50 PM


All times are GMT -5. The time now is 09:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration