title: Python, copy file with creation
body: <p>I'm writing script on Python for copy cron config. I need to copy my file to <code>/etc/cron.d/</code>, and if destination file isn't exist it must be created. I found solution, but it doesn't provide missing file, here it is:</p>
  
  <pre><code>from shutil import copyfile
  
  
  def index():
      src = "/opt/stat/stat_cron"
      dst = "/etc/cron.d/stat_cron"
      copyfile(src, dst)
  
  
  if __name__ == "__main__":
      index()
  </code></pre>
  
  <p>I get exception <code>"FileNotFoundError: [Errno 2] No such file or directory: '/etc/cron.d/stat_cron'"</code></p>
  
  <p>Please, tell me correct solution.</p>