def make_archive(collected_dir, result_path):
formats = {name for name, description in shutil.get_archive_formats()}
for fmt in "xztar", "bztar", "gztar":
if fmt in formats:
archive_format = fmt
break
else:
archive_format = "tar"
shutil.make_archive(result_path, archive_format, collected_dir, "snapshot")
评论列表
文章目录