Solved

RoboCopy Script

Posted on 2013-01-09
8
693 Views
Last Modified: 2013-01-14
Does anyone know how to create a scheduled RoboCopy task to back up the contents of one disk to another?  I would be looking for it to run nightly and only copy new or changed files.  Thanks.
0
Comment
Question by:novanation
8 Comments
 
LVL 28

Accepted Solution

by:
becraig earned 500 total points
Comment Utility
create a schedule task
robocopy  source destination /MIR /S /XO
0
 

Author Comment

by:novanation
Comment Utility
Woudn't that need to be written as a batch file?
0
 
LVL 11

Expert Comment

by:netballi
Comment Utility
0
 
LVL 28

Expert Comment

by:becraig
Comment Utility
you could write it as a batch file however you could also call robocopy as a scheduled task w/o it being a batch file.

You simply need to ensure the account calling the task has the require R/W permissions.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:novanation
Comment Utility
Is there a way for it to generate a log file or some type of report in case files were skipped?
0
 
LVL 28

Assisted Solution

by:becraig
becraig earned 500 total points
Comment Utility
/LOG:file : Output status to LOG file (overwrite existing log)
0
 
LVL 2

Expert Comment

by:perolin
Comment Utility
rem
rem Work kopieren
rem
Resource Kit oder nur als exe
rem 13.06.2008 ms
rem set StartPath=%~d0%~p0

set FileHome=\\srv3\work
set SIScript=D:\Server\Admin\Script
set SILog=D:\Server\Admin\Log
set FileBack=D:\work

echo "%FileHome%" "%FileBack%" /SEC /MIR /COPYALL /R:1 /W:2 /NP /NDL /Log:"%SIScript%\WorkCopy.log"
pause Kopieren ausfuehren?

robocopy "%FileHome%" "%FileBack%" /SEC /MIR /COPYALL /R:1 /W:2 /NP /NDL /Log:"%SIScript%\WorkCopy.log"

rem Copy Logs
set TimeStamp=%date:~-4%%date:~3,2%%date:~0,2%_%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
rem remove spaces (better for filenames ...)
SET TimeStamp=%TimeStamp: =0%
copy "%SIScript%\WorkCopy.log" "%SILog%\WorkCopy_%TimeStamp%.log"
0
 
LVL 26

Expert Comment

by:Leon Fester
Comment Utility
Depending on whether this is a backup script, using the /MIR switch enables mirroring so if any files are deleted from the source then it will also be deleted from the destination.

So unless you have a backup of the backup, you'll not be able to restore files after an accidental delete.

But if you're looking for folder synchronization the use the /MIR switch.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now