Question

Locked

Batch file for backup

By ram@247 ·
Need help in writing a batch file to backup data on microsoft windows server 2003 r2. However i already have written a simple batch file using the xcopy command. Unfortunately it is working fine on my local system, but not on the server. kindly help!!!

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Xcopy is fairly limited

by robo_dev In reply to Batch file for backup

There are some much better tools:

RoboCopy
XXcopy
SyncToy

http://en.wikipedia.org/wiki/Robocopy
http://www.xxcopy.com/
http://en.wikipedia.org/wiki/SyncToy

Collapse -

RoboCopy is always great!

by Andrew Marr In reply to Batch file for backup

For backups I tend to look for something a little extra. You might not want a large backup solution.

For simple tasks I am a fan of syncback

http://www.2brightsparks.com/ - freeware and commercial versions

Collapse -

Agreed

by paradoxstorm In reply to Batch file for backup

RoboCopy is extremely robust and reliable.

Collapse -

Batch file

by ram@247 In reply to Batch file for backup

Thanks for your response. As em very new to programming em yet to learn the use of those commands. However i have written a simple batch file using xcopy which is working fine. Below is the script,

@echo off
REM copy documents
xcopy "E:\Ram\Queries\D1 DUMPING QUERIES" "E:\Ram\" /c /s /r /d /y /i > E:\Ram\xcopy.log

However i now have to modify this script to create a new folder with the system date and time every time this script is run and then backup to that folder.

Would be great if you ppl can help me out with this!!!!

Collapse -

So to clarify

by robo_dev In reply to Batch file for backup

Your challenge is to create a new folder with a name that contains date and time in the name?

Tha't is not too difficult, it's just some simple substitution

http://www.computing.net/answers/windows-2000/creating-folder-in-batch-file/60537.html

set folder=%date:~10,4%%date:~7,2%%date:~4,2%
mkdir %folder%
move c:\temp c:\%folder%

(above example does not include time)

Collapse -

Didn't Work

by ram@247 In reply to Batch file for backup

Thank you very much!!! I modified the script as follows, but didn't work,

set folder=%date:~10,4%%date:~7,2%%date:~4,2%
mkdir %folder%
xcopy "D:\Ram\Doc's\files" "D:\%folder%" /c /s /r /d /y /i > "D:\%folder%\xcopy.log"

What i want his batch file to do is create a new folder in \ with the system time and date as its name and then copy the contents of \Ram\Doc's\files in to it.

Please Advice!!!!!

Collapse -

Need to include time

by ram@247 In reply to Batch file for backup

All, I got the script working, but the script creates a folder with only the current date as its name. How do i include current time as well in the name. Below is my script,

Set FDate=%Date:~-10,10%
Set Fdate=%FDate:/=-%
MD \%FDate%
xcopy "D:\Ram\Doc's\files" "D:\%FDate%" > "D:\%FDate%\xcopy.log"

Please help me modify the script to meet my needs...

Back to Networks Forum
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums