LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 01:56 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
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, 07:37 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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



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 03:41 AM
LXer: Linux 2.6.30 Gets Faster Boot - but is Fedora Faster? LXer Syndicated Linux News 0 06-11-2009 04:40 AM
LXer: Firefox 3.5 Speed Freak: Faster Development, Faster Performance LXer Syndicated Linux News 0 06-10-2009 02:42 AM
move (mv) files faster noir911 Linux - General 6 06-29-2008 11:48 AM
LXer: Firefox 3 Beta 4 is 5x faster than IE7, 3x faster than FF2 LXer Syndicated Linux News 0 03-12-2008 05:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:54 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
Open Source Consulting | Domain Registration