I have a directory with many sub-directories. Each sub-directory contains thousands of files (for a total of 3.5 million). I want to move each file to a single destination directory (remove from sub-directories). However, a process runs on files received so I don't want to dump millions of files at once. I would prefer that it move files from the source to the destination in a bit of a controlled fashion as follows:
Instead of just blasting them through and waiting for 10 seconds to loop as indicated in the script I pasted below, is it possible to have a file move and not have the next file move until the last one is gone from the new destination folder? The destination folder is a cache folder. The files there will not remain very long. Once processed, they are moved again. So, I would like to move each file from /Users/Shared/Source to /Users/usrnm/Documents/Tes
t as indicated in the script below, but I don't want it to move each next file until it verifies that the file it just moved into /Users/usrnm/Documents/Tes
t is no longer present. So, sort of a check and balance control. move all files from A to B, but don't proceed until each last file disappears from B.
Thanks in advance!
sudo mv * /Users/usrnm/Documents/Test