Advertisement

07.23.2008 at 11:24AM PDT, ID: 23589586 | Points: 500
[x]
Attachment Details

Create If/then batchfile

Asked by kpurchase in Windows Batch Scripting

Tags: command line

We have a simple batch file that uses the xcopy command to backup one of our archives to our backup drive. The archive is very large and so it's takes a long time to run. We run the same batchfile everyday, so it's really a full backup job every time. There are 11 main folders and and a number of subdirectories under each of them. We are looking for a command that looks at the highest folder's modified date on the original archive and only backs it up if it has changed. The command should continue to drill through the folder stuctures only backing up the files that have changed. If the modified date has not changed on the folder we want it to move on. We have tried usiing switches but they still look at every file and compare the dates when it doesn't need to. If the modified date on the folder hasn't changed no files in that folder have changed either. Here is an example of what we are using. This works but we  need a faster way to back it up.

set SOURCEROOT=\\Archive1
set DRIVELETTER=E:\
set DESTPATH=Databackup\Archive1

xcopy %SOURCEROOT% %DRIVELETTER%%DESTPATH%Archive1\ /E/C/I/H/D/YStart Free Trial
 
Loading Advertisement...
 
[+][-]07.23.2008 at 11:50AM PDT, ID: 22072563

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 11:51AM PDT, ID: 22072565

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 12:21PM PDT, ID: 22072863

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 12:29PM PDT, ID: 22072936

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 11:02AM PDT, ID: 22081822

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 12:03PM PDT, ID: 22082402

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628