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

07 Nov 2012   #160
acornada

Windows 7 Home Premium SP-1, 64-bit
 
 

Locks on your front door can be a pain, too, especially when you have an armload of groceries. But, removing them entails risk.

Once you learn to manage UAC, it's really not a big deal unless you're constantly installing and uninstalling software.


My System SpecsSystem Spec
.
12 Nov 2012   #161
thesaints

Windows 7 pro x64
 
 

Thanks for this post Golden!!!
Great post and very useful!!! We need more post like this especially a template for daily, weekly Robocopy backup!!!
My System SpecsSystem Spec
19 Nov 2012   #162
Jeckler

Windows 7 Enterprise x64
 
 

Quote   Quote: Originally Posted by acornada View Post
I'm well aware that /MIR = /PURGE + /E. That will never delete files from source.

Quote   Quote: Originally Posted by Microsoft Technet
/PURGE : Deletes destination files and directories that no longer exist in the source.
That means that Robocopy will delete files from destination, if you have deleted them from source.

Neither /PURGE nor /MIR will delete files from source. Please test it, you'll see.
I will NEVER use /MIR in a backup script. If I accidentally delete something but don't notice it, then run my script, where is the file/folder? Nowhere. Poof! Gone! I may not realize the problem for months.
In fact, this exact scenario came up at work just a couple weeks ago. A co-worker had written a robocopy script for a remote file share to backup one USB drive to another. Part of this script was /mir, /mon:1 and /mot:15. Thank whoever that the script wasn't running when I was emailed asking to restore an entire project folder with 3GB 's of data that was accidentally deleted.
People don't seem to realize we're not only backing up in case a drive fails, but also in case someone's brain fails.
My System SpecsSystem Spec
20 Nov 2012   #163
acornada

Windows 7 Home Premium SP-1, 64-bit
 
 

You miss the point. The tutorial says that MIR will delete files from source, which is not true. Neither /PURGE nor /MIR will delete files from source.

As for your situation, yes, what you want is a backup, not a mirroring. Mirroring is a very useful backup technique, but it doesn't replace having archived backups (which is what you want). A mirrored drive or directory ensures that if the source is damaged or fails, you can begin working again from the mirror which is very recent or even real time. Mirroring and point-in-time or archived backups are different techniques, both useful, for different needs.

You still need archived backups, which are backups of files as at a particular point in time. That way, when you realize that you deleted something last week that you now need, you can restore from a two-week-old backup.

But, the tutorial is clearly wrong. Neither /PURGE nor /MIR will delete files from source. Never.
My System SpecsSystem Spec
.

20 Nov 2012   #164
Jeckler

Windows 7 Enterprise x64
 
 

I didn't miss the point. I was round-a-boutly agreeing with you. My point was if /mir is used in a backup scheme, and I accidentally delete something from the source, then run the script, I'm screwed.
My System SpecsSystem Spec
20 Nov 2012   #165
acornada

Windows 7 Home Premium SP-1, 64-bit
 
 

Yep, that would be true. You don't want mirroring, at least not frequent mirroring. I use a combination of archived backups and a mirrored backup. Both are useful, for different goals.
My System SpecsSystem Spec
21 Nov 2012   #166
ITspecialist

Windows 7 Ultimate x64
 
 

Hello, I cannot get this script to work???CMD prompts and just keeps running this data over and over? please help
robocopy E:\Data1 G:\Backups\Data1 robocopy F:\Data2 G:\Backups\Data2 robocopy F:\Data3 Q:\Backups\Data3 pause
My System SpecsSystem Spec
21 Nov 2012   #167
ITspecialist

Windows 7 Ultimate x64
 
 

Nice tutorial I will definitely use this!!!
My System SpecsSystem Spec
21 Nov 2012   #168
acornada

Windows 7 Home Premium SP-1, 64-bit
 
 

Quote   Quote: Originally Posted by ITspecialist View Post
Hello, I cannot get this script to work???CMD prompts and just keeps running this data over and over? please help
robocopy E:\Data1 G:\Backups\Data1 robocopy F:\Data2 G:\Backups\Data2 robocopy F:\Data3 Q:\Backups\Data3 pause
1. That won't work, AFAIK, you can't just string together separate commands/tasks and enter them all as a single line into CMD.

2. If you want to have all three of those tasks run, do it in a batch file, where each is on a separate line.
My System SpecsSystem Spec
21 Nov 2012   #169
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Welcome to SevenForums,

Try this:

Code:
 
robocopy E:\Data1 G:\Backups\Data1
robocopy F:\Data2 G:\Backups\Data2
robocopy F:\Data3 Q:\Backups\Data3
pause
Regards,
Golden
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 11:25.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App