Nightly backup or sync

A

Auddog

I have started to backup my laptop daily by syncing to a nas unit at my
office. I'm currently using xcopy at the command line because it plain and
simple. My only problem that I can see is when I delete an item on my
laptop it doesn't get deleted from my nas. Here is my script I'm using:

xcopy c:\temp\*.* \\nas\test /d/e/y/i>nul

Does anyone know how to get xcopy to work like a sync program? Thanks for
any help you maybe able to provide.

A
 
K

Kerry Brown

Delete the files on the NAS first. Personally I'd copy them to another
folder first in case something goes wrong with the backup.

del \\nas\test1\*.* /r /h /s
xcopy \\nas\test\*.* \\nas\test1 /e
del \\nas\test\*.* /r /h /s
xcopy c:\temp\*.* \\nas\test /e

If you put this in a .cmd file then you should do some error checking to
make sure everything worked. If you enter it from the command line then
don't use >nul. You will miss any error messages.
 
L

Lanwench [MVP - Exchange]

In
Auddog said:
I have started to backup my laptop daily by syncing to a nas unit at
my office. I'm currently using xcopy at the command line because it
plain and simple. My only problem that I can see is when I delete an
item on my laptop it doesn't get deleted from my nas. Here is my
script I'm using:
xcopy c:\temp\*.* \\nas\test /d/e/y/i>nul

Does anyone know how to get xcopy to work like a sync program? Thanks for
any help you maybe able to provide.

A

You might consider using robocopy from the resource kit (download it) and
use the /MIR switch to mirror. Run it once without that switch, tho.
robocopy /??? will give you all the parameters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top