robocopy

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
I have a question about using robocopy. I used to use Xcopy in XP but now im on vista and can no longer use Xcopy. Now this is the command line switch I used but cannot figure out how to achieve these results in robocopy. Is there a how to for dummies on this software because I read the help file it came with and its got me all confused.. Xcopy was so much easier...thanks,
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
xcopy/m/e/r/v/y C:\MC_workfiles G:\MC_workfiles

forgot to post the command line switches..my bad

wanting it to create hte directories and sub directories and copy all files from source dir as well as un check the archive attribute once the backup to other source has been completed. also wanted it verify new files and also overwrites existing files without prompting you. reason for that is if I modify file then backup it will overwrie old file with new one.. thanks
 
Last edited:

gimp

[H]F Junkie
Joined
Jul 25, 2008
Messages
10,470
if you don't want CLI, you can always go with RichCopy which has some improvements over Robocopy
 

Demon10000

Supreme [H]ardness
Joined
Aug 20, 2006
Messages
4,502
Why can't you use xcopy? I'll admit, I don't have a vista box to check it against, but I dropped to a command prompt on my Win7 x64 box and it's still there. I can't see them removing it from Vista.

Are you sure you just don't have an f'd up path variable? From a command prompt, try this:

c:\Windows\system32\xcopy.exe

and see if that works.
 

Demon10000

Supreme [H]ardness
Joined
Aug 20, 2006
Messages
4,502
It's still included but it's deprecated.

how so?

It works fine for what it's always done. It's not like Robocopy is new or anything, it's just the first time MS has included it with an OS. It's usually some external download you have to go hunt down. If XCopy has been working for the OP, then it'll continue to work just fine...
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
I use to use xcopy till they depriciated it in vista. Its still there in the command prompt but it will error out when trying to be used. after doing some research I found out why. its no longer supported in vista and as far as 7 goes I havent made it to that OS yet...no job = no money..
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
Is there not a option to create the directory from the source path to the new source path cause all I can get it to do is copy the files only and not the directory to my backup drive. and what is this N level option I keep reading about when I scroll over options to read what each one does.
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
ok I tried an experiment to copy a test folder and files to the same C drive in a different named folder . so I ran the proper commands and it created the new directory for me in the folder I pointed it to and it worked. my problem is Im trying to accomplish this to my NAS raid 5 setup so if my main pc fails I will still have my pics,music etc. when I run the same commands to copy them to a designated folder on my NAS it just dumps all the files and does not create the directory that they reside in from the source path.
 

keenan

2[H]4U
Joined
Aug 5, 2009
Messages
2,695
Show your commands....

IIRC if you put a trailing \ on the source, it will just copy files.
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
If all you are doing is syncing a directory, maybe SyncToy would work better for you....

I tried that once it didnt do what I am wanting. it would delete files from my backup if they ever got removed from the original directory or visa versa.. thats not what Im wanting.. I wish Xcopy was still usable and problem solved. I had batch files for different actions that I needed to perform as well as a backup batch file that worked flawlessly.. but this robocopy wont do what xcopy would do..yes robocopy does have alot more features but they removed some of the most basic and sometimes needed options that I loved about Xcopy..
 

Snowknight26

Supreme [H]ardness
Joined
May 8, 2005
Messages
4,388
xcopy is still usable, and I'm pretty sure that robocopy can do everything you want done - it's just a matter of finding the correct switches.
 

Demon10000

Supreme [H]ardness
Joined
Aug 20, 2006
Messages
4,502
I tried that once it didnt do what I am wanting. it would delete files from my backup if they ever got removed from the original directory or visa versa.. thats not what Im wanting..

Robocopy will do that too, so be careful of your switches

I wish Xcopy was still usable and problem solved. I had batch files for different actions that I needed to perform as well as a backup batch file that worked flawlessly.. but this robocopy wont do what xcopy would do..yes robocopy does have alot more features but they removed some of the most basic and sometimes needed options that I loved about Xcopy..

I use xcopy on Win7 all day long and I've never had any problems with it. What problems are you having with it that make you think it's broken?
 

JBark

2[H]4U
Joined
Dec 13, 2002
Messages
2,048
These two commands I think should do it:
verify on
robocopy /e /m /b C:\MC_workfiles G:\MC_workfiles

/e - recursive
/m - only copy files with Archive set and reset
/b - backup mode, so it overwrites read-only files

'verify on' will force robocopy to verify the files it copies. The verify command actually affects all copy commands that run in that command shell, so any copy, xcopy, move, etc... will all verify.
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
Robocopy will do that too, so be careful of your switches



I use xcopy on Win7 all day long and I've never had any problems with it. What problems are you having with it that make you think it's broken?

if you run the Xcopy command in a command prompt window in Vista it will tell you it is now been depriciated and to please use robocopy..I dont have the money to get windows 7 yet but some day I will.. but for now just trying to figure out the robocopy..
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
this robocopy sucks.. I ran it today to copy my documents folder to my backup NAS storage and it copied the my documents dir and left it empty and then put all the files that were in it in the directory of the folder I pointed for my backups to be placed at on my NAS.. Is there anything else out there that works like xcopy and is freeware or affordable?? Im at the point now of having better success of copy and pasting my files from one place to another as a means of backup than using robocopy.I would honestly do this if I could keep track of all the new or updated files so as to not have to copy all of the files every time. I want to copy them all one time only then update the backup source as new files are introduced with the archive bit set..robocopy wants to put folders and files where ever it feels like.. I dont see how this honestly has ever became a popular software. Xcopy was full proff in my mind. I have several batch files I use on a daily basis on XP machines and if I need to write a new file with different commands its easy as can be and also its going to work when I run it.. I dont know why microsoft would go and depreciate a software that worked good and replace it with something that dosent...I may go back to XP and get rid of vista totally and I cant see & going to be any better if things like this are going to happen with every new OS they release...
 

jpochedl

Limp Gawd
Joined
Jun 7, 2004
Messages
345
I've used robocopy for years to move hundreds of terabytes of data between servers.. I've never seen it move files into the wrong directories...

I'm curious, what NAS are you using?

If you add the /LOG:<filename> option on robocopy, can you post the log when this happens?
 

JBark

2[H]4U
Joined
Dec 13, 2002
Messages
2,048
I don't understand it either. Robocopy is extremely easy to use and takes about five minutes to figure out how it works. Hell the commands I posted above are exact duplicates of the original xcopy command. And in most cases, it even uses the same command line switches as xcopy, so takes no time at all to convert an xcopy to a robocopy.

Or use RichCopy, which somebody else posted. It's GUI based and can do just about every feasible copy operation you could every possibly want to do.

Or just continue to use xcopy. It's not deprecated on 7 (as many people have already said), so who cares if you see that message Vista. They obviously decided to not get rid of it after all, so will be supported for years.
 

elation

Gawd
Joined
Feb 4, 2003
Messages
792
I use job files for robocopy. I find they make it a lot easier to go back and modify things later if needed. Plus they're just easier to read than a string of switches. I created robocopy jobs on external hard drives for quick backups. I slide them into my dock (love my CM case) and click on the batch file. Done and done! :D

Here's a link to the switches: http://technet.microsoft.com/en-us/library/cc733145(WS.10).aspx

There should be a .doc that has everything you need to know about robocopy packaged with it. Or is it in the 2003 resource kit? Hmm... Google will probably turn up something.
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
I've used robocopy for years to move hundreds of terabytes of data between servers.. I've never seen it move files into the wrong directories...

I'm curious, what NAS are you using?

If you add the /LOG:<filename> option on robocopy, can you post the log when this happens?

Im using a buffallo terastation .5TB NAS Ive also had problems when I tried to use windows backup in vista ultimate to get my files to backup to it. It errors out when I give it the login and pass to create the connection across the network. The NAS itself is old and no longer made due to the increased amount of space that can be had today.but when I bought it 1TB was biggest you could get at the time..I can succesfully backup with Xcopy to this device from my other machine running XP pro but the vista ultimate machine something aint jiving out right cause I have run commands that were neccesarry to maintain the dir structure and copy files with only archinve bit and all that but its going crazy on me.. I will try the log command that someone else had mentioned and see what it says..


P.S. can some one tell me what /LEV switch is.. it says it copies only the top N levels of the source directory tree.. what is this I dont get it and its not explained in detail in the guide.
 
Last edited:

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
here is the log and at the bottom is what im talking about it fails to copy the main source dir "Pictures" to the destination dir inside of the backups folder. It just creates everything in the picture folder in the backups folder with out preserving the pictures folder dir. if I do this how can I organize my pics from my docs and my music and so on if it wont create the main dir im trying to copy over and backup.its just dumping everything into the destination folder and calling it done.


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

  Started : Wed Aug 04 16:15:08 2010

   Source : C:\pictures\
     Dest : D:\backups\

    Files : *.*
	    
  Options : *.* /V /S /COPY:DAT /PURGE /MIR /NP /M /R:10 /W:30 

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

	                   3	C:\pictures\
	       archive		  171307	calender select.jpg
	       archive		  134376	calender select1.jpg
	       archive		  171307	calender select2.jpg
	  New Dir          4	C:\pictures\10_31_03 alex halloween\
	       archive		  127073	10_31_03_alex halloween 001.jpg
	       archive		  133896	10_31_03_alex halloween 002.jpg
	       archive		    5632	Thumbs.db
	       archive		   11996	ZbThumbnail.info
	  New Dir          6	C:\pictures\10-31-05\
	       archive		  241152	ehthumbs_vista.db
	       archive		  703768	IMG_0146.JPG
	       archive		  688849	IMG_0147.JPG
	       archive		  644103	IMG_0148.JPG
	       archive		   17920	Thumbs.db
	       archive		   19834	ZbThumbnail.info
	  New Dir          9	C:\pictures\12_23_04\
	       archive		  315181	house.JPG
	       archive		  495080	IMG_0111.JPG
	       archive		  562305	IMG_0112.JPG
	       archive		  596532	IMG_0113.JPG
	       archive		  508622	IMG_0114.JPG
	       archive		  436231	IMG_0115.JPG
	       archive		   29184	Thumbs.db
	       archive		  314476	truck.JPG
	       archive		   44543	ZbThumbnail.info
	  New Dir          3	C:\pictures\12-22-02_2\
	       archive		  436868	12-22-02_2 006.jpg
	       archive		   53248	Thumbs.db
	       archive		    9365	ZbThumbnail.info
	  New Dir          8	C:\pictures\2003-06 (Jun)\
	       archive		  434224	IMG_0197.JPG
	       archive		  388318	IMG_0198.JPG
	       archive		  320636	IMG_0199.JPG
	       archive		  388053	IMG_0200.JPG
	       archive		  392721	IMG_0201.JPG
	       archive		  375047	IMG_0202.JPG
	       archive		    8192	Thumbs.db
	       archive		   39715	ZbThumbnail.info

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

                Total    Copied   Skipped  Mismatch    FAILED    Extras
     Dirs :         6         5         1         0         0         0
    Files :        33         0        33         0         0         0
    Bytes :    8.79 m         0    8.79 m         0         0         0
    Times :   0:00:00   0:00:00                       0:00:00   0:00:00

    Ended : Wed Aug 04 16:15:08 2010
 

keenan

2[H]4U
Joined
Aug 5, 2009
Messages
2,695
You are putting a trailing slash on the source folder, which I mentioned way up the thread.
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
You are putting a trailing slash on the source folder, which I mentioned way up the thread.

I guess I missed that but yes I see what you mention but this is done buy robo gui not myself.. it automatically puts the trailing slash in.. I will take it out and see what happens..
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
ok this is the bat file commands ran

robocopy "C:\pictures" "R:\Backups" /MIR /S /M /V /FP /NP /LOG:"test2" /R:10 /W:30

now in the gui interface in the path selections it also leaves out the trailing command on both source and destination but the log files show it I dont knwo why..


and this is what the test log 2 says


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

  Started : Wed Aug 04 18:01:06 2010

   Source : C:\pictures\
     Dest : R:\Backups\

    Files : *.*
	    
  Options : *.* /V /FP /S /COPY:DAT /PURGE /MIR /NP /M /R:10 /W:30 

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

	                   3	C:\pictures\
	    New File  		  171307	C:\pictures\calender select.jpg
	    New File  		  134376	C:\pictures\calender select1.jpg
	    New File  		  171307	C:\pictures\calender select2.jpg
	  New Dir          4	C:\pictures\10_31_03 alex halloween\
	    New File  		  127073	C:\pictures\10_31_03 alex halloween\10_31_03_alex halloween 001.jpg
	    New File  		  133896	C:\pictures\10_31_03 alex halloween\10_31_03_alex halloween 002.jpg
	    New File  		    5632	C:\pictures\10_31_03 alex halloween\Thumbs.db
	    New File  		   11996	C:\pictures\10_31_03 alex halloween\ZbThumbnail.info
	  New Dir          6	C:\pictures\10-31-05\
	    New File  		  241152	C:\pictures\10-31-05\ehthumbs_vista.db
	    New File  		  703768	C:\pictures\10-31-05\IMG_0146.JPG
	    New File  		  688849	C:\pictures\10-31-05\IMG_0147.JPG
	    New File  		  644103	C:\pictures\10-31-05\IMG_0148.JPG
	    New File  		   17920	C:\pictures\10-31-05\Thumbs.db
	    New File  		   19834	C:\pictures\10-31-05\ZbThumbnail.info
	  New Dir          9	C:\pictures\12_23_04\
	    New File  		  315181	C:\pictures\12_23_04\house.JPG
	    New File  		  495080	C:\pictures\12_23_04\IMG_0111.JPG
	    New File  		  562305	C:\pictures\12_23_04\IMG_0112.JPG
	    New File  		  596532	C:\pictures\12_23_04\IMG_0113.JPG
	    New File  		  508622	C:\pictures\12_23_04\IMG_0114.JPG
	    New File  		  436231	C:\pictures\12_23_04\IMG_0115.JPG
	    New File  		   29184	C:\pictures\12_23_04\Thumbs.db
	    New File  		  314476	C:\pictures\12_23_04\truck.JPG
	    New File  		   44543	C:\pictures\12_23_04\ZbThumbnail.info
	  New Dir          3	C:\pictures\12-22-02_2\
	    New File  		  436868	C:\pictures\12-22-02_2\12-22-02_2 006.jpg
	    New File  		   53248	C:\pictures\12-22-02_2\Thumbs.db
	    New File  		    9365	C:\pictures\12-22-02_2\ZbThumbnail.info
	  New Dir          8	C:\pictures\2003-06 (Jun)\
	    New File  		  434224	C:\pictures\2003-06 (Jun)\IMG_0197.JPG
	    New File  		  388318	C:\pictures\2003-06 (Jun)\IMG_0198.JPG
	    New File  		  320636	C:\pictures\2003-06 (Jun)\IMG_0199.JPG
	    New File  		  388053	C:\pictures\2003-06 (Jun)\IMG_0200.JPG
	    New File  		  392721	C:\pictures\2003-06 (Jun)\IMG_0201.JPG
	    New File  		  375047	C:\pictures\2003-06 (Jun)\IMG_0202.JPG
	    New File  		    8192	C:\pictures\2003-06 (Jun)\Thumbs.db
	    New File  		   39715	C:\pictures\2003-06 (Jun)\ZbThumbnail.info

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

                Total    Copied   Skipped  Mismatch    FAILED    Extras
     Dirs :         6         5         1         0         0         0
    Files :        33        33         0         0         0         0
    Bytes :    8.79 m    8.79 m         0         0         0         0
    Times :   0:00:02   0:00:02                       0:00:00   0:00:00

    Speed :             3763164 Bytes/sec.
    Speed :             215.330 MegaBytes/min.

    Ended : Wed Aug 04 18:01:09 2010



thanks guys,.,,
 

JBark

2[H]4U
Joined
Dec 13, 2002
Messages
2,048
That's because you are telling it to start inside the pictures folder....

Try this:
robocopy "C:\pictures" "R:\Backups\pictures" /MIR /S /M /V /FP /NP /LOG:"test2" /R:10 /W:30
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
That's because you are telling it to start inside the pictures folder....

Try this:
robocopy "C:\pictures" "R:\Backups\pictures" /MIR /S /M /V /FP /NP /LOG:"test2" /R:10 /W:30

yeah thats what I just ran and posted above,. test 2 read the details of the code
 

JBark

2[H]4U
Joined
Dec 13, 2002
Messages
2,048
yeah thats what I just ran and posted above,. test 2 read the details of the code

No, it's not the same.

Yours:
robocopy "C:\pictures" "R:\Backups" /MIR /S /M /V /FP /NP /LOG:"test2" /R:10 /W:30

Mine:
robocopy "C:\pictures" "R:\Backups\pictures" /MIR /S /M /V /FP /NP /LOG:"test2" /R:10 /W:30
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
they are not same read the log...thats how i want it backed up the backups folder is the folder I want the main dir pictures in without having to create it first..I want pictures dir in backups dir. same as what my log specifies.. what you have is stating there is a picture folder existing already and there is not.. the whole problem is it wont create the main dir pictures in the backups folder.just copies the files from the pictures folder to the backups folder
 

jpochedl

Limp Gawd
Joined
Jun 7, 2004
Messages
345
What JBark said is correct. If you want to copy "C:\pictures" to "R:\Backups\pictures" then you need to tell Robocopy the destination is "R:\Backups\pictures"

Robocopy can create subdirectories, but it won't create the starting directory.
 

nomak

Limp Gawd
Joined
Oct 20, 2004
Messages
419
What JBark said is correct. If you want to copy "C:\pictures" to "R:\Backups\pictures" then you need to tell Robocopy the destination is "R:\Backups\pictures"

Robocopy can create subdirectories, but it won't create the starting directory.

you hit the nail on the head with creating main directory thats the whole problem.

and I am running the following command lines "R:\Backups\pictures"

If I create the pictures dir. there are no problems when I dont then there is a mess.. so I just have to create my main dir before I can use robocopy.. at least xcopy would create a main dir if it did not exist....
 
Top