Xcopy help
Author
Discussion

fish

Original Poster:

4,061 posts

306 months

Wednesday 28th July 2004
quotequote all
Help I'm using xcopy to backup files from one server to another and I want to exclude a folder or two at present this text (with xcopy out to see what it going to do) still lists the J:EMAilbackup folder which I do not want to copy.

How do I amend it to not copy the email folder?

Current batch file is:

xcopy j: z: /o/x/e/k/h/l/f/i/y/d/exclude:>xcopy.out
"j:EMailBackup"


Any help appreciated, I've tried differnt permutations on the file path as well

Jay-Aim

598 posts

265 months

Wednesday 28th July 2004
quotequote all
haven't got time to look for you

try this link www.robvanderwoude.com/index.html

he's very good and has helped in the past

>> Edited by Jay-Aim on Wednesday 28th July 18:39

Podie

46,649 posts

299 months

Wednesday 28th July 2004
quotequote all
I don't think you need the > after the exclude switch.

_DJ_

5,052 posts

278 months

Wednesday 28th July 2004
quotequote all
fish said:
Help I'm using xcopy to backup files from one server to another and I want to exclude a folder or two at present this text (with xcopy out to see what it going to do) still lists the J:EMAilbackup folder which I do not want to copy.

How do I amend it to not copy the email folder?

Current batch file is:

xcopy j: z: /o/x/e/k/h/l/f/i/y/d/exclude:>xcopy.out
"j:EMailBackup"


Any help appreciated, I've tried differnt permutations on the file path as well



Wrong order. The '>' symbol redirects output. The folder name should therefore come before '>'.

D

chrisjl

787 posts

306 months

Wednesday 28th July 2004
quotequote all
fish said:
(with xcopy out to see what it going to do)


_DJ_ said:
Wrong order. The '>' symbol redirects output. The folder name should therefore come before '>'.


He wants to capture the output of the command - I think the PistonHeads sanitizer has interfered with the original meaning.

> xcopy source destination /{lots_of_parameters} /EXCLUDE:exclude_list.txt > output.txt

Where:
exclude_list.txt is a file CONTAINING a list of files to exclude

And:
output.txt contains a report of what happened

fish

Original Poster:

4,061 posts

306 months

Thursday 29th July 2004
quotequote all
I only added the >xcopy.out to create a list of files rather than actually do it as a test.

The above text does work but the list that is generated still shows the email stuff. I've read the notes etc but can't understand what it means by listing the exclusions as seperate string on their own lines.

Could anyone amend my origional to exclude a number of sample folders?

Cheers

trevorw

2,875 posts

306 months

fish

Original Poster:

4,061 posts

306 months

Thursday 29th July 2004
quotequote all
Yep I've got that tech sheet and I've tried to get it to work but I need an example that works rather than the funny brackets....

malman

2,258 posts

283 months

Thursday 29th July 2004
quotequote all
Xcopy command along the line of this but with your options

XCOPY /R /E /Y "c:\somdirsome\file" "d:\somedir" /exclude:c:\xcopyexclude.txt

Then create a text file called xcopyexclude.txt (for above example) which contains a list of excludes each on its own line eg.

\emaildir\
*.txt
*.msg

The first line exludes any path with emaildir in it
The second exclude any .txt file etc

Does that work for you?

>> Edited by malman on Thursday 29th July 15:14

plotloss

67,280 posts

294 months

Thursday 29th July 2004
quotequote all
Are you doing a distance learning course in computing?

fish

Original Poster:

4,061 posts

306 months

Thursday 29th July 2004
quotequote all
Right off to the server room for a play

fish

Original Poster:

4,061 posts

306 months

Thursday 29th July 2004
quotequote all
It works thanks for everyones help

m12_nathan

5,138 posts

283 months

Thursday 29th July 2004
quotequote all
Use ROBOCOPY instead, much better (can be found in the reskit)