Link to home
Start Free TrialLog in
Avatar of jana
janaFlag for United States of America

asked on

Help on using robocopy to move the files

We are moving lots of files from one location to another.  

Files Info:
- the source and destination are located in the same external USB seagate drive 3TB.  
- Few files are 15gb in size others are 20mb+ in size.
- We are currently using windows 10 "move" procedure:
   - right-click and hold on source folder
   - drag the mouse to destination folder
   - release right-mouse button
   - click on "move here"
 
The problem:  
- 50% of the times and even more, halts at 99% completion and stays there until the computer decide to finish
or let go and close the  process
- few times message of "too long file name" and needs our intervention to "skip" files

Recommended solution:
In order to successfully move our files to the new location as solid as possible, we were recommended to use robocopy, so we turn to EE for help.  Please advice on the following using robocopy:

  • First, we don't want to loose any data during the process.
  • We want to move all contents to destination within the same location drive, a seagate drive.
  • We need to include when moving, all empty folders if any exist in source location.
  • If it's possible, we want to continue the process uninterrupted by any errors such as "too long file name".
  • If any errors during the move occurs, we don't want those sources folders/files deleted during the process from source location.
  • Finally, capture some sort of log of files all folders/files that were not successfuly moved; like a log or something similar we can go back an see what happened.


Thanx in advance.
Avatar of Qlemo
Qlemo
Flag of Germany image

A move inside of the same file system (partition) is a fast operation, as only the file metadata is changed (for files bigger than the cluster size, usually 4k). Are you indeed moving that way? And by doing so, the final path can get longer than before?
Avatar of jana

ASKER

Don't quite understand your question, but maybe yes? (yes to "Are you indeed moving that way?" and yes to "the final path can get longer than before?")

So you can help us, these are the sole locations of data-travel:

Source location:

E:\!a\2013-1127.034930

All folders under this folder is to be move.  So if we have:

E:\!a\2013-1127.034930\MyDocs
E:\!a\2013-1127.034930\Download
E:\!a\2013-1127.034930\MyPix

We want to move MyDocs, Download and MyPix folders.  We don't want to move "\!a\2013-1127.034930" folder.

Destination location:

E:\!a\!c

In this folder we want the final MyDocs, Download and MyPix folders moved


Please Note:
There a series of source folder similar to E:\!a\2013-1127.034930, that is:

E:\!a\2013-1201.034930
E:\!a\2014-0115.096582
E:\!a\2015-1013.012436
E:\!a\2016-1206.087451
etc.

These source folder holds copies of actual working folder and we are restoring them from older-to-new dates so we can have the the contents as it was in 2016-1206.


Hope this gave a more detail scope of our task.
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Thanx, but have some question.  We did reviewed the link you gave us but can't seem to quite grasp the reason for the arguments in the command.  So we hope you can clear it up.  We assume the arguments you supplied is based on our needs so we just want to understand the parameters we can't grasp:

What does this do to our process?
/mt:32 - Creates multi-threaded copies

Is this necessary?
/R:0      - Specifies the number of retries on failed copies
/W:0     - Specifies the wait time between retries

If we don't use this, the destination will not create the source parents-folders?
/fp        - Includes the full path names of the files in the output.

What is this?
/njh      - Specifies that there is no job header.

Looks like is for logging error, yes?  If so, why not logged them?
/ndl      - Specifies that directory names are not to be logged.
/nfl       - Specifies that file names are not to be logged.

Displayed? Don't we want them displayed?
/np       - Specifies that the progress of the copying operation (the number of files or directories copied so far) will not be displayed.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Great info Thanx!

Ok, ran the following:

robocopy E:\!a\2013-1127.034930\MyDocs E:\!a\!c /move /mt:32 /R:0 /W:0 /fp /log+:e:\!a\zRobocopy.log

Open in new window


And it returned the following:

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Tuesday, December 6, 2016 12:37:50 PM
   Source : E:\!a\2013-1127.034930\MyDocs\
     Dest : E:\!a\!c\

    Files : *.*
	    
  Options : *.* /FP /DCOPY:DA /COPY:DAT /MOVE /MT:32 /R:0 /W:0 

------------------------------------------------------------------------------

	    New File  		    1192	E:\!a\2013-1127.034930\MyDocs\osdata.lnk
  0%  
100%  

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         1         1         0         0         0
   Files :         1         1         0         0         0         0
   Bytes :     1.1 k     1.1 k         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
   Ended : Tuesday, December 6, 2016 12:37:50 PM

Open in new window



However, the following:
- it didn't move the empty folders from source location
- it moved 1 file and to the root of E:\!a\!c\ not within the folder path of the source location
  The file 'osdata.lnk' was move to E:\!a\!c\osdata.lnk not to its actual folder in source, MyDocs\osdata.lnk
You might have to add /e to move empty folders.

The correct test command to keep the "root" folder intact, and including the /e, would be
robocopy E:\!a\2013-1127.034930\MyDocs E:\!a\!c\MyDocs /move /e /mt:32 /R:0 /W:0 /fp /log+:e:\!a\zRobocopy.log

Open in new window

Note that you have to supply MyDocs twice.
Avatar of jana

ASKER

ok will do.

In 'Note that you have to supply MyDocs twice.', your mean:

Source : E:\!a\2013-1127.034930\MyDocs\
Dest : E:\!a\!c\MyDocs\

Open in new window


Also, if done, will it move all sub-folders within "\MyDocs\"?
It should!
Avatar of jana

ASKER

Ok what about if files already exist? (since we are moving files from same-name source but updated to-recent dates)
By default only older files are replaced, so this should work for you.
Avatar of jana

ASKER

' older files are replaced' - if we use robocopy to copy a older-date of a file to the destination where the same file is but in a newer date, the copy will not proceed?

(we need to have files replaced at  the destination no matter the date)
Does that really make sense? If a file is newer, it should not be replaced usually. But if you really want to do that, add /IS (include same).
Avatar of jana

ASKER

We agree, unfortunately there specific files which has to be replaced no matter what.

Thanx.