I have a task to move more than 35000 files every two hours, from the same directory to another directory based on a file that has the list of filenames
I tried the following logics
(1)
find . -name \*.dat > list
for i in `cat list` do mv $i test/ done
(2)
cat list|xargs -i mv "{}" test/
logic 1 takes 40mins and logic 2 in 25 mins
Is there any other faster way I can move files based on a file that has the list of filenames.
Just a suggestion..... Not sure if this is even an option for your environment.
Don't move the files first. Just create links from the old dir to the new dir. run the link command first. then come back and move the files to over write the link. this way the files are available very quickly and your move cmd can take 40 minutes.