cancel
Showing results for 
Search instead for 
Did you mean: 

robocopy issue and subfolders long path names

TomSmith9
Level 2

I I used robocopy many times, it copied all files during each run again. I believe that it only does copy files when spotting a difference between source and target in name, timestamp, or size. I tried this :

/NDL /NFL /S /E /COPY:DAT /PURGE /MIR /MT:8 /R:3 /W:10

Where's the problem ?

in the other hand we face a long path names issue with some  subfolders that are  in different  places , any one have a solution that would not consume our time when copying  ? 

1 ACCEPTED SOLUTION

Accepted Solutions

As Andro said , try to use the /FFT switch .. in the other hand don't use /W:10 /R:3 - if a file is open, now you're waiting 30 seconds for ONE file to attempt to be copied.  Also, don't forget to try the /L switch which is "list-only" mode to make sure you at least have the right source and target, especially when running /MIR - if you inadvertently have the source and destination reversed, you would wipe your data before realizing it :\ 

... for the problem of long path names ,are they all in subdir's or spread out all over the place? Just make sure your target is set to be one level down also.  Then just schedule them as separate batch files and you'll definitely cut the time down.   however, if they're all over the place, creating 100+ separate jobs would be counterproductive.  If they are within the same tree structure, create a batch that starts further down into the subdir, then you can exclude that in the batch file that copies the rest of the structure, if that makes sense.  The switch to exclude a folder is /XD dir (so, it would look like /XD \\server\share\sub1\sub2\sub3) which will definitely shorten your path names.  also if you don't need to consume much time in your issue just try to google robocopy alternatives which used before save my time like gsrichcopy360 and securecopy quest  , I hope you will find your answer 

View solution in original post

6 REPLIES 6

SenioraSwan
Level 2

you don't need /MIR because it's a pruge 

/NDL and /NDF are for logging, not sure what you wouldn't log that?
(e.g. /LOG:C:\batch\RoboLog.txt /NFL /NDL)

you don't need (/s , /e )  as  /MIR does that  already

/COPY:DAT (that is the default anyways) 

/COPY:DAT (that is the default anyways) 
(copyflags : D=Data, A=Attributes, T=Timestamps S=Security=NTFS ACLs, O=Owner info, U=aUditing info)

/w is wait between retries and
/r is the number of retries

/MT is for multi threat and 8 is the default, again not needed thus.

we can do it in  way easier like 

Text
Robocopy <source> <destination> /MIR /COPYALL /R:3 /W:10 /tee /log:<logpath>.log

Now why it copes every time, not sure. That's why you want to write a log and you can look at the log. it could be that it skipped the file and tried to copy again next round.

The system informed me that  I don't have the necessary rights to use auditing functions because of the /COPYALL switch. So I had to eliminate it.):

ROBOCOPY <source> <target> /MIR /R:3 /W:10 /LOG:<logfile>

All files get copied during each run. I found the same reason code for each file in the log: OLDER. I inspected the modified date in source and target files. They are identical. 

we know that Robocopy comparing files useing  local and remote time . If files are being copied each time with /MIR, it means both local time is too different from remote machine you're copying to. make sure both machines are using the reliable and coherent time source for time synchronization or Use either /FFT switch (more tolerant at time comparison) . I recommend you to use the first solution , but anyway I use /FFT  .

As Andro said , try to use the /FFT switch .. in the other hand don't use /W:10 /R:3 - if a file is open, now you're waiting 30 seconds for ONE file to attempt to be copied.  Also, don't forget to try the /L switch which is "list-only" mode to make sure you at least have the right source and target, especially when running /MIR - if you inadvertently have the source and destination reversed, you would wipe your data before realizing it :\ 

... for the problem of long path names ,are they all in subdir's or spread out all over the place? Just make sure your target is set to be one level down also.  Then just schedule them as separate batch files and you'll definitely cut the time down.   however, if they're all over the place, creating 100+ separate jobs would be counterproductive.  If they are within the same tree structure, create a batch that starts further down into the subdir, then you can exclude that in the batch file that copies the rest of the structure, if that makes sense.  The switch to exclude a folder is /XD dir (so, it would look like /XD \\server\share\sub1\sub2\sub3) which will definitely shorten your path names.  also if you don't need to consume much time in your issue just try to google robocopy alternatives which used before save my time like gsrichcopy360 and securecopy quest  , I hope you will find your answer 

thanks SenioraSwan  

Your solution is smart but it will take too much time , I am doing good now with gs richcopy360 , all issues that I mentioned before in my post solved .

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

@TomSmith9 

This topic has nothing to do with Veritas SaaS backup or any Veritas product for that matter.

I will mark this post as 'Inappropriate content'.