title: Copy only files that are newer
body: <p>I am currently using this code:</p>
  
  <pre><code>    if (!Directory.Exists(command2)) Directory.CreateDirectory(command2);
  
      if (Directory.Exists(vmdaydir)) Directory.Delete(vmdaydir,true);
  
      if (!Directory.Exists(vmdaydir)) Directory.CreateDirectory(vmdaydir);
  
      var dir = Path.GetDirectoryName(args[0]);
  
      sb.AppendLine("Backing Up VM: " + DateTime.Now.ToString(CultureInfo.InvariantCulture));
      Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(dir, vmdaydir);
      sb.AppendLine("VM Backed Up: " + DateTime.Now.ToString(CultureInfo.InvariantCulture));
  </code></pre>
  
  <p>As you can see, I am deleting the directory, then I am copying the folder back. This is taking way to long since the directory is ~80gb in size. I realized that I do not need to copy all the files, only the ones that have changed.</p>
  
  <p>How would I copy the files from one folder to another but only copying the files that are newer?  Anyone have any suggestions?</p>
  
  <p>==== edit ====</p>
  
  <p>I assume I can just do a file compare of each file and then copy it to the new directory, iterating through each folder/file?  Is there a simpler way to do this?</p>