Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: ROBOCOPY - Create Backup Script

08 Sep 2014   #240
CC123

Microsoft Windows 7 Home Premium 64-bit 1-Pack for System Builders - OEM
 
 

Hi, I just started using Robocopy to backup my files to my JBOD recently and I noticed that it does not copy anything in My Document folder. Here is the result log for Robocopy regarding the backup.
Quote:
------------------------------------------------------------------------------

Total Copied Skipped Mismatch FAILED Extras
Dirs : 4287 0 4287 0 0 0
Files : 34164 22831 11333 0 0 0
Bytes : 107.783 g 90.408 g 17.375 g 0 0 0
Times : 20:32:46 2:02:26 0:00:00 0:15:26

Ended : Mon Sep 08 02:58:21 2014

-------------------------------------------------------------------------------
Even though it says that it copied 22831 files the destination folder says it has not been modified at all.



The strange thing is that when I was checking back on the progress in the cmd window, it showed that it was copying files. The problem is I have no idea where those files went, the files that were supposedly copied aren't there at all. Here is the script I used to back up my files.

Quote:
robocopy F:\Anime G:\Anime /mir /copyall /np /tee /mt /log:"C:\Users\C.C\Desktop\my_backup_log.txt"

robocopy "E:\Disk Backups" "G:\Disk Backups" /mir /copyall /np /tee /mt /log+:"C:\Users\C.C\Desktop\my_backup_log.txt"

robocopy E:\Downloads G:\Downloads /mir /copyall /np /tee /mt /log+:"C:\Users\C.C\Desktop\my_backup_log.txt"

robocopy E:\Movie G:\Movie /mir /copyall /np /tee /mt /log+:"C:\Users\C.C\Desktop\my_backup_log.txt"

robocopy "C:\Users\C.C\My Documents" "G:\My Documents" /mir /copyall /np /tee /mt /log+:"C:\Users\C.C\Desktop\my_backup_log.txt"

robocopy E:\Text G:\Text /mir /copyall /np /tee /mt /log+:"C:\Users\C.C\Desktop\my_backup_log.txt"

pause
The other folders seem to have been mirrored correctly, it's just the My Documents folder that is having this issue.

I tried deleting the destination folder I currently had on the backup disk and ran robocopy again. It skipped right through the document script. It seems like it's saving somewhere but I don't know where. Here is the result.

Quote:
------------------------------------------------------------------------------

Total Copied Skipped Mismatch FAILED Extras
Dirs : 4287 0 4287 0 0 0
Files : 34163 0 34163 0 0 0
Bytes : 107.783 g 0 107.783 g 0 0 0
Times : 0:03:11 0:00:00 0:00:00 0:03:11

Ended : Mon Sep 08 09:51:19 2014

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



My System SpecsSystem Spec
.
25 Sep 2014   #241
shygounder

windows 8 64bit
 
 
ROBOCOPY

Can someone write me an robocopy script for the following;

- copy a folder
- different backup sets for each day
- delete backups sets for each day when overwritten
- also check for all files are being copied
- backup log

Thanks a million in advance
My System SpecsSystem Spec
11 Nov 2014   #242
Reksbar

Windows 7 Professional 64 Bit
 
 
Robocopy commands fail in script not in command

Hello,

I have several ROBOCOPY commands in a script. 1 of the command lines fails when running it in the script.

The error I receive is: ERROR 2 (0x00000002) Accessing Source Directory W:\sales\Bibliothèque sacs Holweg\ The system cannot find the file specified.

When I run the ROBOCOPY command in the command window it executes flawlessly.

Here is the specific command line: ROBOCOPY "W:\sales\Bibliothèque sacs Holweg" "d:\dept\sales\Holweg Transfer\Bibliothèque sacs Holweg" /MIR /COPY:dat /R:1 /W:1 /TEE /LOG:d:\Scripts\Logs\Hol_sales_2.txt

Any suggestions?

Thank you!
My System SpecsSystem Spec
11 Dec 2014   #243
gridsystems

Windows 7 Pro 64-bit
 
 

As regards the template towards the end of the first post in this thread, I am curious as to what the following line means:
Quote:
rem --- The /mir option has been left out for safety sake
Why is it more safe to disallow the creation of a new file alongside the original?
My System SpecsSystem Spec
.

11 Dec 2014   #244
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

When I first put this together, I was mistakenly under the impression that \mir could inadvertently delete the original source file, so I included that rem statement. I'll remove it from the template this evening.
My System SpecsSystem Spec
11 Dec 2014   #245
gridsystems

Windows 7 Pro 64-bit
 
 

Actually, hold that thought...
I ran a test trying to sort out my option switches. And files were actually deleted. Perhaps I can counter that by adding /XX. I will try.
Sorry, was confusing source and destination.

But what really surprised me was the log file that showed a host of switches that were not present in my command line. They seem to have defaulted in. Is that expected? If MIR is E+PURGE, then why are all three of them in the generated command line?

Code:
robocopy "G:\musica\_lectures" "E:\##testrobot" /e /mir /np /tee /mt:4 /log:robocopy_backup_log.txt
pause
yielded:

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

  Started : Thu Dec 11 23:26:47 2014

   Source : G:\musica\_lectures\
     Dest : E:\##testrobot\

    Files : *.*
	    
  Options : *.* /TEE /S /E /COPY:DAT /PURGE /MIR /NP /MT:4 /R:1000000 /W:30 


                       //// etc etc etc ////
My System SpecsSystem Spec
19 Feb 2015   #246
Jenee

Windows 7 Professional, 64-bit
 
 
How to locate skipped files in backup log

Hi Golden,

This is my first time using this program; your tutorial is the only thing I've come across that is actually helpful (I am not a tech person and other how-tos have assumed the reader is tech-savvy already).

So, thank you for this!

I was finally able to write a script that did what we want it to do; however, I noticed that it skipped a file/folder the second time, but hadn't skipped anything the first time.

The difference between the first and second times are that on the second run, I'd added the /log: switch to create a log file.

How can I find out what folders/files are skipped after a backup has been completed? Is there anything in the log that identifies skipped data?

Thanks much,
Jenee
My System SpecsSystem Spec
19 Feb 2015   #247
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Can you paste a copy of your .bat and log file here, and I'll have a look at it for you?
My System SpecsSystem Spec
19 Feb 2015   #248
Jenee

Windows 7 Professional, 64-bit
 
 

Sure, here is the .bat script:

robocopy "J:\SOPs_from Public Drive" "H:\Work Stuff\SOPs\BACKUPS\SOP Public Backup as of 02-19-15" /E /tee /log:backup_log.txt
robocopy "J:\Standard Operating Procedures_SOPs" "H:\Work Stuff\SOPs\BACKUPS\SOP Training Backup as of 02-19-15" /E /tee /log:backup_log.txt
pause

I will attach the log file because it is a LOT of data....you might even change your mind about looking through it for me, lol.


Attached Files
File Type: txt backup_log - SOP Training Backup as of 02-19-15.txt (191.4 KB, 208 views)
My System SpecsSystem Spec
05 Aug 2015   #249
N74JW

Windows 8.1 x64
 
 
Script Doesn't Work

I've tried this script verbatim with no luck. I even created the test directories manually, and the script still wouldn't work (Windows 7, Windows 10).
My System SpecsSystem Spec
Comment

 ROBOCOPY - Create Backup Script




Tutorial Tools Search this Tutorial
Search this Tutorial:

Advanced Search




Similar help and support threads
Windows 7 Tutorial Category
robocopy script is not working through Scheduler
Dear All, My batch file of robocopy is working fine. But when I tried to run it through task scheduler, none of the files transfer to the target location. @echo off echo +-----------------------------------------+ echo Database Export Utility for server ...
General Discussion
Robocopy Backup - ERROR 5 (0x00000005)
Hi, I'm wondering if anyone might be able to shed some light on why I am getting the following such errors when running a robocopy batch file (as administrator) which cause the backup script to stall (- albeit temporarily): I am using the following backup command: robocopy "%srcPath%\My...
Backup and Restore
How 2 create a script/BAT or something that changes my desktop image?
Okay so I just got this program called Transparent Screen Lock and you can run files when the program starts/locks and closes/unlocks. What I would like to do is create a script or something that changes my desktop background to an image when I click "lock" and another script to change the desktop...
Customization
Robocopy backup for personal folders
I have created a batch file for copying my Documents folder to an external hard drive: The log file shows that it is backing up C:\users\USERNAME\documents\My Music and C:\users\USERNAME\documents\My Pictures. That's fine, because I want those backed up anyway, but when I go to...
Backup and Restore
I Need Help To Create REG. Script With Admin. Priv. For Reg. Editor?
Hello. I have a technical question/issue I wish to ask. I hope someone can help me. I am looking help for someone to modify or rewrite for me a simple system registry script for my context menu that allows or forces to "run as administrator" privileges automatically when I click on the...
Customization
Anyone use robocopy to backup?
Evening all, Just curious to know if anyone uses the built in utility to backup software on your machine, im trying to backup my itunes folder to an external HD but having a few issues to get this to work properly! I also use sync toy for backing up but just really want to know what everyone...
Backup and Restore


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 19:25.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App