Jump to content
Compatible Support Forums
Sign in to follow this  
HELLBRINGER

xcopy - doesn't work properly

Recommended Posts

I'm having a problem getting the xcopy command to work properly on a server that I am trying to backup. I created a MS-DOS batch file with the simple command "xcopy e: y:\ /d /e /c /h /r /k /o /y". This should, theoretically, copy all data from drive E: to drive Y:, regardless of date, not overwriting files newer than the one being copied, retaining attributes, etc. It is then being run by "Schedueled Tasks" every morning of every Monday, Wednesday, and Friday at 02:00 hours.

 

The first few times worked successfully, but after a few times, it simply stopped working. It no longer even seems to copy files at all.

 

I don't understand why it is not working. Maybe I am doing something wrong, or mis-interpruted one of the switches. If anyone could help me out i would be most greatful. Perhaps I should use a program designed for backing up data automatically, instead of this xcopy, which I cannot seem to get to work properly.

 

Thx

Share this post


Link to post

The account that runs the task, has the password changed or has the account changed in anyway?

 

Do you get the same errors when running xcopy from the command line?

 

Why not use ntbackup to do this? Best part its free :-) Worse part is it doesnt do remote system states.

 

Have you tried other tools like robocopy (from the resource kit) to do this?

 

just some $0.02

Share this post


Link to post

thanks for the response...

 

i don't get any errors at all, it simply, executes the file, and nothing happens. when i run it manually, same thing. i haven't tried typign it into the command line lately, i will try that again.

 

ntbackup... is it automated? or can it be? i just need regular nightly backups of data onto a remote server... thats all, very simple.

 

i haven't tried other tools, nor have i looked because i am quite lazy. lol, sorry, but its the truth. some admin i am huh? heh...

 

thanks for your help

Share this post


Link to post

Yes NTBACKUP can be scheduled, and it will do what you want xcopy to do. A plus side is that there are logs created by the app to tell you when and how and if it fails.

 

I wouldnt use xcopy for a daily, reliable backup

 

The syntax looks right .. you check to make sure the mapping for the Y drive is still there?

Share this post


Link to post
Quote:
thanks for the response...

i don't get any errors at all, it simply, executes the file, and nothing happens. when i run it manually, same thing. i haven't tried typign it into the command line lately, i will try that again.

ntbackup... is it automated? or can it be? i just need regular nightly backups of data onto a remote server... thats all, very simple.

i haven't tried other tools, nor have i looked because i am quite lazy. lol, sorry, but its the truth. some admin i am huh? heh...

thanks for your help


xcopy E: Y:\ /D /E /C /H /R /K /O /Y
------------------------------------------------------------------------------
source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set,
doesn't change the attribute.
/M Copies only files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/V Verifies each new file.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
assumes that destination must be a directory.
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files that would be copied.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy files. Does not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U Copies only files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only attributes.
/N Copies using the generated short names.
/O Copies file ownership and ACL information.
/X Copies file audit settings (implies /O).
/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y Causes prompting to confirm you want to overwrite an
existing destination file.
/Z Copies networked files in restartable mode.

he switch /Y may be preset in the COPYCMD environment variable.
his may be overridden with /-Y on the command line.
--------------------------------------------------------------------------------
Yup... seems to be alright.. (/Z looks usefull)

Does xcopy work locally? Try it with some local directory. Trying to find if
this is a network thing. This isn't Novell I assume ;-).

xcopy 'should' be about the most bullitproof thing on your system.
Lazy is one thing, but, replacing it with a more complicated GUI when you already know that xcopy will do the job, is just plain lame. laugh Trouble shoot the dam thing.

Share this post


Link to post

As for me, I'm with DS3Circuit on this. NTBACKUP works very well, although it wasn't until Win2K that you could backup to a file. I usually have NTBACKUP run cascading jobs, and then a scheduled single copy for each server to upload its backup to the central backup server. This works out pretty well, as you only have one large file per machine being copied, rather than thousands of smaller files that can get hung up or stalled out during a copy. Also, NTBACKUP is integrated into other MS apps (Exchange for one) and makes restoring a server very, very easy.

Share this post


Link to post

or you can use the Full ver of NTBackup (Veritas Backup Exec). I use this at work to backup around 30 servers to DLT and to file and I also use it at home to backup to my External USB2/Firewire drives. I love it! I love the backup! smile

Share this post


Link to post

wow! thats for all the help guys i will do this when i get to work...

 

judging by the overall opinion of this NTBackup, it has a GUI? That'd be nice.

 

About the backup, maybe the Y:\ drive is not there. I mean, it is, but it gets "disconnected" according to explorer, even though if you double-click it it goes to it. The tihng is, drive Y:\ is a wireless connection to another HD on another Server in another building. The wireless network is bridged, with 14dB gain antennas on 2 WAPs about 150 meters apart. Seems to work well. We are sharring a DSL line at one end, this way, we only have to pay for one DSL, and the networks can be connected as one. Pretty sweet setup. Unfortinatly, I think the connection only goes about 1.5 Mbps max. Most of the time, it feels like around 800Kbps.

 

Anyway I will try that NTBackup and see if it will work out. Sounds impressive, I don't know why I never saw that. I"m assuming its the regular backup prog that comes with Win2k Server?

 

Thanks for all the help guys, very much appreciated.

Share this post


Link to post

NTBACKUP = GUI and CLI ... Comes with Win2k Server

 

Veritas BackupExec 8.x is fine, but perhaps overkill for what his needs are.

 

You "can" setup a Win2k group policy to keep the drives from becoming idle "the red X on the drives."

 

Under local/Domain security policy / Local policies / Security Policies / Amount of Idle time before disconnecting session ... default should be 15 minutes, change it to what suites your security needs.

 

Basically its how long a SMB session should last before disconnecting.

 

With household WAPs, that is what you can expect with 802.11b, speed wise ... add VPN overhead, and it will further lessen.

 

Can I suggest purchasing a DAT5/DLT/LTO ($$$) tape drive. It would provide a more solid, speeder backup over a better medium.

 

Any more questions? Thanks for the support fellas.

 

DosFreak ... ever thought about switching to ArcServe Backup laugh ?

Share this post


Link to post

Cool. I just got back from work, and tested it out. Seems to be quite a handly little utility. I don't know why I never used it. I've always seen it, but never used it cause I assumed it sucked like the Win98 one.

 

I will change that setting so the drive will stay connected the time I need.

 

As for the tape drive. Well, they are quite expensive. Right now they do not have the budget to even get a new scanner for $150. So for now we have to make do with what we have.

 

Thanks for the help.

Share this post


Link to post

Well a few weeks trial... and this isn't working so great. I can't find a way to do what I need.

 

Is what I want is to have it create a backup file, of the ENTIRE drive (d:\). Then, every night, I want it to update, not add the files that were changed since the last backup. I had this backup file getting MASSIVE becuase it was just growing.

 

I can't find out how to do this, maybe i'm just stupid. Can someone explain how to do this with MS backup... or, if I can't, suggest a program that can.

 

Thanks...

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×