Is there way to get RoboCopy to put those 200 modified file onto a USB while conserving their parentage structure ?
For instance
OldStructure
Root\Bob has many subfolders at multiple levels, but no recently modified files anywhere.
root\Chris also has no changes anywhere
root\Joes has this structure
.\Ohio has no changes at any level
.\NY has 20 folders and 100 files at multiple levels, but there was only file modified was:
root\Joe\NY\Construction\Mainstreet\plan.pdf (modified yesterday)
The ideal robocopy would create a single file on the USB:
f:\smallFolder\Joe\NY\Construction\Mainstreet\plan.pdf
Nearly perfect, except it will creates and delete about 80,000 unnecessary folders which make it run really slowly.
Any suggestions?
rberke
P.S. When I specify from 11/08/2017 to 11/09/2017, files changed on 11/8 are copied and files changed on 11/09 are NOT copied. So I will always add 1 to the most recent date desired.
NVIT
...except it will creates and delete about 80,000 unnecessary folders ...
Unfortunately, that's how robocopy works. It makes the empty folders. Hence, the need for the following RD line.
You may be able to do it with FORFILES without the following RD line. IDK if that's faster than the robocopy method.
Robert Berke
ASKER
Actually, robocopy had other problems. For some reason it stalls at pst files. They stay on the screen from for many minutes while a processed percentage works its way up to 100%. Maybe it is reviewing each email? Anyway, it looks like it is a dead end.
do you think you could come with a forfiles command? I am not good at that stuff. If not, I will give you points for your previous answer and close the question.
NVIT
I can take a look. IDK if I can finish today. I'm in the middle of something right now... 8-)
NVIT
As far as the PST issue... I don't think it matters if robocopy or forfiles is used. Both use COPY commands. If those are large pst files, it will surely take awhile to copy.
Also, If the PST file is open, i.e. being used by someone, robocopy or forfiles COPY won't be able to copy the pst file. Because Outlook locks the file. Until the user closes Outlook.
Robert Berke
ASKER
I was wrong, the PST was not a problem. It was just a big file that took 5 minutes to copy.
My full job ran for about 80 minutes . The good news is that this an acceptable period of time, so I am closing the question and awarding you points.
But, I still believe an ideal solution without the useless folders would run in half the time.
Here are a few statistics in case anybody is interested. All numbers are chancy because I did not keep an accurate log.
To get timing statistic I removed your delete loop and reran the job. It ran much faster and finished in 60 minutes
This created C:\aatmp\arobotest2 with 1037 files in 61,084 folders.
I tnen ran your delete logic on arobtest2. It ran for about 20 minutes
and changed C:\aatmp\arobotest2 to have 1037 files in 172 folders.
So, 60,818 useless folders were deleted in 20 minutes.
My guess is that creating those useless foders also took an additional 20 minutes.
So, the ideal robocopy should have taken 40 minutes instead of 80 minutes.
So, while your solution is not ideal, it works fine.
Any suggestions?
rberke
P.S. When I specify from 11/08/2017 to 11/09/2017, files changed on 11/8 are copied and files changed on 11/09 are NOT copied. So I will always add 1 to the most recent date desired.