Computing.Net > Forums > Programming > Robocopy in a Batch File

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Robocopy in a Batch File

Reply to Message Icon

Name: ace_omega
Date: September 28, 2009 at 15:59:04 Pacific
OS: Windows 2003 Server
CPU/Ram: Quad Core / 4Gig
Product: Hewlett-packard SERVER
Subcategory: Batch
Comment:

I am trying to make a script to copy the users local files every 6 hours. I got one that works but I want to modify it so that it only does differential copies to save disk space. Here is the code I have...

@echo off
Set Monthfolder=Monthly\%Date:~-4,4%-%Date:~-10,2%
Set Dailyfolder=Daily\%Date:~-4,4%-%Date:~-10,2%\%Time:~-11,2%;%Time:~-8,2%;%Time:~-5,2%

@echo Backing up local files...

@\\10.100.100.7\scripts\robocopy "%userprofile%" \\10.100.100.7\backups\userfiles\%username%\%Dailyfolder% *.do* /if *.xl* /if *.pdf /if *.pp* /if *.txt /XD %userprofile%\AppData /XD "%userprofile%\Application Data" /s /COPY:DAT /r:1 /w:1 /np > h:\BackupLog.txt
@\\10.100.100.7\scripts\robocopy "%userprofile%" \\10.100.100.7\backups\userfiles\%username%\%monthfolder% *.pst* /XD %userprofile%\AppData /XD "%userprofile%\Application Data" /s /COPY:DAT /r:1 /w:1 /np >> h:\BackupLog.txt

Need a robocopy expert.



Sponsored Link
Ads by Google

Response Number 1
Name: l0ngsh0t
Date: September 28, 2009 at 20:02:27 Pacific
Reply:

Try tossing the "/xo" argument in your string. That will only copy files newer than the destination version.


0

Response Number 2
Name: ace_omega
Date: September 30, 2009 at 09:22:14 Pacific
Reply:

I need it to compair with an old directory or a master copy and only backup the files that where changed like a differential but more of a shadow copy.


0

Response Number 3
Name: ace_omega
Date: September 30, 2009 at 13:57:48 Pacific
Reply:

Ok, after thinking about this what I have come with is that I need to somehow log what was backed up and compare the date time for changes and only backup what has changed. So not just a differential but a shadow copy.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Robocopy in a Batch File

Extract comp. alias in a batch file www.computing.net/answers/programming/extract-comp-alias-in-a-batch-file/11253.html

Get a Folder size in a batch file www.computing.net/answers/programming/get-a-folder-size-in-a-batch-file/9587.html

Putting Sound in a batch file www.computing.net/answers/programming/putting-sound-in-a-batch-file/15461.html