import os import shutil import sys # print out python version info print('\n' + '-' * 50) print('Python version info:') print(sys.version) print('-' * 50 + '\n') # clean up existing files for pth in ['demo_files', 'demo_files2', 'demo_files3', '/tmp/demo_files']: if os.path.exists(pth): shutil.rmtree(pth) # create a directory tree for copying os.mkdir('demo_files') with open('demo_files/example.txt', 'w') as fh: fh.write('example') # copy files across filesystems print('Copying NFS --> /tmp') shutil.copytree('demo_files', '/tmp/demo_files') print('Copying /tmp --> NFS') shutil.copytree('/tmp/demo_files', 'demo_files2') print('Copying NFS --> NFS') shutil.copytree('demo_files', 'demo_files3')