Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using a batch file to copy a database backup file using robocopy (on Windows 7/2008) and need to restore (with replace) the database only after the backup file is really changed (not skipped by robocopy).

robocopy \\server\share . foo.bak /TBD /NP

Tried testing errorlevel but it doesn't help. Anyone has some suggestion to achieve such objective?

Thanks.

share|improve this question

migrated from stackoverflow.com Feb 13 '10 at 7:15

This question came from our site for professional and enthusiast programmers.

A bit inelegant I admit, but write a log file and then parse it?

share|improve this answer
    
Not at all inelegant. Robocopy has a number of options for logging: ss64.com/nt/robocopy.html – jscott Feb 13 '10 at 13:22
    
+1. Exactly, use Robocopy's logging options. – joeqwerty Feb 13 '10 at 14:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.