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

13 May 2012   #60
JOSHSKORN

Windows 7 Ultimate 64-bit
 
 
Script Help

Hi, I'm new to using robocopy and want some assistance.

First of all, I've managed to create a script based on the first example that will copy files from two different sources to two different destinations using an example from the OP. This is what I am currently using.

Code:
robocopy "C:\Users\Josh\Documents\Backup Files" "F:\Backup Files" /e /mir /np /log:backup_log.txt
robocopy "C:\Users\Public\Recorded TV" "F:\Recorded TV" /e /mir /np /log+:backup_log.txt
pause
A couple things:
  • With the first folder, Backup Files, I will be continuously adding files to the source. Occasionally, I want to update the destination, Backup Files on my external drive, leaving both source and destination files intact. Files will never be saved in the destination folder, only the source folder, then copied over when a backup is performed.
  • With the second folder, Recorded TV, I am wanting to MOVE files from one destination to the other, IF the file contains the names "Program 1", "Program 2", "Program 3" (as an example). Otherwise, I only want to copy (NOT move) the rest of the contents over, leaving it in both source and destination.
If I can get some help on this, thanks in advance.


My System SpecsSystem Spec
.
14 May 2012   #61
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Hi,

The first line of the script will work fine for your first case - keeping "Backup Files" synchronised between F: and C:.

The second request is more complex as it's conditional to the existence of a name of a recorded program - how will the script know the name of the program?

Regards,
Golden
My System SpecsSystem Spec
16 May 2012   #62
Andysdad

Win 7 64 bit
 
 

Golden, please, a little help, you seem to be the man. Strange issue using robocopy, it acts like its copying everything, but when i look in the folder, its empy. Yet other command lines work fine.

Example:this line wont work:

robocopy "C:\users\andysdad\My Documents" "e:\backup\My Documents" /S /A

But this line will:

robocopy "c:\users\andysdad\downloads" "e:\backup\downloads" /S /A

???
My System SpecsSystem Spec
17 May 2012   #63
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Hi,

I'll have a look at this when I get home this evening, and post back here.

Regards,
Golden
My System SpecsSystem Spec
.

17 May 2012   #64
Andysdad

Win 7 64 bit
 
 

No hurry, thanks
My System SpecsSystem Spec
17 May 2012   #65
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

OK. Can you try this again:

Quote:
robocopy "C:\users\andysdad\My Documents" "e:\backup\My Documents" /S /A
and then copy & paste the contents from the output screen here?

Regards,
Golden
My System SpecsSystem Spec
17 May 2012   #66
Andysdad

Win 7 64 bit
 
 
I will

As soon as i get home later today, thanks much
My System SpecsSystem Spec
17 May 2012   #67
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

No worries - I'll keep visiting back here to check it out.
My System SpecsSystem Spec
17 May 2012   #68
Andysdad

Win 7 64 bit
 
 
Test

Lunch time test gives the error "error 5 (0x00000005) accessing source directory c:\users\andysdad\My Documents\

Access is denied.
My System SpecsSystem Spec
17 May 2012   #69
Andysdad

Win 7 64 bit
 
 

Sorry , forgot to run as Admin.
Again usb drive started flashing like it was copying something, but nothing in backup directory, output

dirs: total468 copied25 skipped443
files 7956 copied 6 skip[ped 9750
bytes total 16.101g copied 234.29
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 13:42.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App