title: Make this directory sync script detect change and run in the background
body: <p>I have this simple python script which will synchronize the contents of <code>sourcedir</code> folder to <code>targetdir</code> folder.</p>
  
  <p>Here is the code;</p>
  
  <pre><code>from dirsync import sync
  
  sourcedir = "C:/sourcedir"
  targetdir ="C:/targetdir"
  sync(sourcedir, targetdir, "sync")
  </code></pre>
  
  <p>It is cumbersome to manually run this script whenever changes are made. I would like to have this script running in the background so that whenever there is any change in <code>sourcedir</code> folder, <code>targetdir</code> folder will be synchronized automatically.</p>
  
  <p>I am using python v3.5  </p>