So here's the situation: I have 700000 files in one folder(all *.db). To minimize loading on the server I'd like to move 10000 at a time, then pause for 2 minutes. I don't need any particular order. I just want to prevent moving them all at once. All of the files in this folder are .db so no need to figure out which files are db and which aren't.
Basically, I want to be able to do this:
mv /mnt/tank/folder1/*.db to /mnt/tank/folder2 (but only 10000 from the source folder).
wait 2 minutes
repeat above 2 steps until /mnt/tank/folder1 is empty.
I have a program that will import the .dbs into our new bigger database and it monitors the folder for changes, but I don't want to dump all of the databases at the same time or the new database will go crazy for days. So I need to feed it small amounts at a time.
So how do I build a script to do this? I've tried alot of Google searches but I'm getting nowhere fast. I figured I'd ask here since there's lots of helpful smart people that probably can provide the answer off the top of their head.
Basically, I want to be able to do this:
mv /mnt/tank/folder1/*.db to /mnt/tank/folder2 (but only 10000 from the source folder).
wait 2 minutes
repeat above 2 steps until /mnt/tank/folder1 is empty.
I have a program that will import the .dbs into our new bigger database and it monitors the folder for changes, but I don't want to dump all of the databases at the same time or the new database will go crazy for days. So I need to feed it small amounts at a time.
So how do I build a script to do this? I've tried alot of Google searches but I'm getting nowhere fast. I figured I'd ask here since there's lots of helpful smart people that probably can provide the answer off the top of their head.