We help IT Professionals succeed at work.

back up questions

eteran
eteran asked
on
Medium Priority
241 Views
Last Modified: 2010-03-05
I have this back up script which runs every night. The problem is that when the code runs the first time it works perfect but when it runs the second day it dose not look to see for changes to add It simply looks at the folder name and if it is there then moves on. How do I make it check inthe subfolders for chagnes and save those files.

net session /delete /Y
xcopy /o /e /v /y F:\ H:\
Comment
Watch Question

Author

Commented:
I have win2k server
3_S

Commented:
you could first do a complete delete of all file on you H:
are there files on the H: which aren't any more on the F: and you have to keep? Or you just want to take every night an exact copy of the F: ?
You are talking about how much data (MB,GB,??)

Author

Commented:
TRhe data about is to much to take out and replace. The data amount is 75 gigs. I would like it to compare each file and take the change files only
3_S

Commented:
I tried your command and it is working perfect for me.

If a file is deleted in you original folder it stays in your archive folder. Is this the problem you are looking at.

Changed files (in folder or subfolder) are overwritten with your xcopy command.

change line as followed to test the script (after running the script you should see the result of you xcopy command) I don't thing there's somebody at night looking what the script is doing exactly
xcopy /o /e /v /y F:\ H:\  > c:\temp\log.txt      

Author

Commented:
> c:\temp\log.txt   this will create  a log file for me.?
3_S

Commented:
Yes this will create a log file.
check this file in the morning to see if everything went well during the nightly copy
you can adjust the path to your needs, or change filename

use >> if you want to append to file, but be carefull that your disk does not run full if you append

Author

Commented:
For some resaon when I run this code I see the command window pop up and go away right awway.  While if I delete everything in j:\ and run the script you see it transfer everthing. Why would this be.
net session /delete /Y
xcopy /o /e /v /y F:\ J:\ > c:\temp\log.txt
Commented:
Open a dosbox (command window) and type in the command manually (this way the command window does not go away and you can read what is happening)

is there something in you log.txt? maybe error message?

Explore More ContentExplore courses, solutions, and other research materials related to this topic.