I have a million+ files spread across four fiber-connected arrays. I need to get the path, filesize, and last_modified date to insert into a mysql database. What would be the best way to do this?
Here is what I am currently doing:
sudo find "$FULFILLMENT" "$ARCH1" "$ARCH2" "$MASTERING" -type f -exec ls -lT {} + > $FILE
And then I parse that file (using Python) to insert it into my db.
What would be the best way to accomplish the above?
findcommand take to complete? In any case, I do believefindis the most appropriate tool for listing the files. – Gerry Feb 1 at 22:55findcommand takes about 99% of the time. – David542 Feb 1 at 23:00find -type f -ls, though I'm not sure that will make any significant difference. It sounds like there just is a lot of data to process. – Gerry Feb 1 at 23:04