Skip to content

Instantly share code, notes, and snippets.

@motleytech
Created December 5, 2018 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motleytech/f6b2b6f9d3aedef6bcebb766a03c0ba2 to your computer and use it in GitHub Desktop.
Save motleytech/f6b2b6f9d3aedef6bcebb766a03c0ba2 to your computer and use it in GitHub Desktop.
Rsync like functionality using python distutils.dir_util.copy_tree
import sys
import distutils.log
import distutils.dir_util
import os
if len(sys.argv) != 3:
print ('Usage : python pysync2.py src dest')
exit(1)
src, dest = map(os.path.abspath, sys.argv[1:])
distutils.log.set_verbosity(distutils.log.DEBUG)
distutils.dir_util.copy_tree(
src,
dest,
update=1,
verbose=1,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment