backup_docker_volumes.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:chef_community_cookbooks 作者: DennyZhang 项目源码 文件源码
def copytree(src, dst, symlinks=False, ignore=None):
    for item in os.listdir(src):
        s = os.path.join(src, item)
        d = os.path.join(dst, item)
        if os.path.isdir(s):
            # TODO: better way to copy while skip symbol links
            try:
                shutil.copytree(s, d, symlinks, ignore)
            except shutil.Error as e:
                logging.warning('Warning: Some directories not copied under %s.' % (s))
            except OSError as e:
                logging.warning('Warning: Some directories not copied under %s.' % (s))
                # logging.warning('Some directories not copied. Error: %s' % e)
        else:
            shutil.copy2(s, d)

################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号