Computing.Net > Forums > Programming > Batch Backup Issues (XCOPY)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch Backup Issues (XCOPY)

Reply to Message Icon

Name: Trisket
Date: May 21, 2009 at 08:25:13 Pacific
OS: 2000/XP/Vista
CPU/Ram: Various
Product: Various / VARIOUS
Subcategory: Batch
Comment:

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%



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: May 21, 2009 at 18:11:46 Pacific
Reply:

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.


0

Response Number 2
Name: Trisket
Date: May 22, 2009 at 09:07:37 Pacific
Reply:

Such as?


0

Response Number 3
Name: Razor2.3
Date: May 22, 2009 at 10:34:20 Pacific
Reply:

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).


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch Backup Issues (XCOPY)

Backup using xcopy - date in folder www.computing.net/answers/programming/backup-using-xcopy-date-in-folder/16705.html

Batch File - controled backup www.computing.net/answers/programming/batch-file-controled-backup/14024.html

Batch file issues: batch renaming www.computing.net/answers/programming/batch-file-issues-batch-renaming/12034.html