Solved

RoboCopy Script

Posted on 2013-01-09
8
696 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 29

Accepted Solution

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

Author Comment

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

Expert Comment

by:netballi
ID: 38760666
0
 
LVL 29

Expert Comment

by:becraig
ID: 38760673
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Author Comment

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

Assisted Solution

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

Expert Comment

by:perolin
ID: 38760793
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
ID: 38760936
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Restore Server 2012 R2 Registry 4 53
Bizarre hard disk problem 15 105
data center consolidation 8 88
Solaris SUN OS 4.1.3 cloning 6 74
Are you looking to recover an email message or a contact you just deleted mistakenly? Or you are searching for a contact that you erased from your MS Outlook ‘Contacts’ folder and now realized that it was important.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

930 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

10 Experts available now in Live!

Get 1:1 Help Now