Batch Backup Issues (XCOPY)

Various / VARIOUS
May 21, 2009 at 08:25:13
Specs: 2000/XP/Vista, Various
Hello world,
I have two problems. Firstly:
In its current form, my batch file gets the job done, but I get a few sharing violations. I don't have any desire to back up these files, but they stall the script. I'd like to skip these files, but when I add an exclude list, it excludes every file in the parent directory in that line of the script. (Obviously my syntax is wrong.)

Second, If a customer is a heavy outlook user, they will be unable to open outlook until the batch completes, because the .psts don't copy correctly if they're in use. What I would like to do is make the first line of my script backup the psts, and exclude the psts from the line that backs up the Application Data parent directory to minimize their outlook downtime.

This is my script:
REMThe following line needs an /exclude for ntuser.dat
xcopy "C:\docume~1\%username%\local settings" "P:\Backup\Hidden Files" /e /y /d /r /i /h
REMThe following line needs an /exclude for .pst
xcopy C:\docume~1\%username%\applic~1 "P:\Backup\hidden files" /e /y /d /r /i /h

xcopy "C:\docume~1\%username%\my documents" "P:\backup\User Data" /e /y /d /r /i /h
REMThe following line needs an /exclude of .mdf
xcopy "C:\program files" "P:\backup\Program Files" /e /y /d /r /i /h
exit

Any help is appreciated. As an inexperienced user, I'm open to any suggestions of how to improve my script.

*Edit*
Added use of %homepath%


See More: Batch Backup Issues (XCOPY)

Report •


#1
May 21, 2009 at 18:11:46
REMThe following line needs an /exclude for .pst
xcopy C:\docume~1\%username%\applic~1 "P:\Backup\hidden files" /e /y /d /r /i /h

echo .pst>exc
xcopy C:\docume~1\%username%\applic~1 "P:\Backup\hidden files" /e /y /d /r /i /h /exclude:exc

I'd like to skip these files, but when I add an exclude list, it excludes every file in the parent directory in that line of the script. (Obviously my syntax is wrong.)
Agreed.
A better answer requires more information.


Report •

#2
May 22, 2009 at 09:07:37
Such as?

Report •

#3
May 22, 2009 at 10:34:20
Such as the input you're giving it, and what part of the output is unexpected (ie the full paths of files excluded that you want to copy).

Report •

Related Solutions


Ask Question