back up questions

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:\
eteranAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
3_SConnect With a Mentor 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?
0
 
eteranAuthor Commented:
I have win2k server
0
 
3_SCommented:
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,??)
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
eteranAuthor 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
0
 
3_SCommented:
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      
0
 
eteranAuthor Commented:
> c:\temp\log.txt   this will create  a log file for me.?
0
 
3_SCommented:
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
0
 
eteranAuthor 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
0
All Courses

From novice to tech pro — start learning today.