Programming/python python 에서 tar.gz 파일 만들기 - 기록용으로 남깁니다. 이 글을 참고했습니다. with tarfile.open("zipped.tar.gz", "w:gz") as tar: tar.add(f"/tmp/01.log") sourcefile은 압축할 파일이고 zipped.tar.gz 는 생성될 압축 파일입니다. tar cvzf zipped.tar.gz /tmp/*.log 와 유사한 결과가 생성된다고 보시면 됩니다. 간단하죠? ㅎㅎ 공유하기 게시글 관리 구독하기sr's lair 저작자표시 동일조건 'Programming > python' 카테고리의 다른 글 [python] 윈도우10에서 python.exe 실행 경로 확인하기 (0) 2021.07.01 [python3][vscode][pylance] operator "in" not supported for types literal and str int float 26,12 오류 끄기 (0) 2021.06.24 [python3] 인스턴스의 클래스 이름 출력하기 (0) 2021.05.03 [python] 소켓이 사용중인 포트 확인하기 (0) 2021.02.09 [python] json.dumps object of type bytes is not json serializable (0) 2020.12.22 Contents 당신이 좋아할만한 콘텐츠 [python] 윈도우10에서 python.exe 실행 경로 확인하기 2021.07.01 [python3][vscode][pylance] operator "in" not supported for types literal and str int float 26,12 오류 끄기 2021.06.24 [python3] 인스턴스의 클래스 이름 출력하기 2021.05.03 [python] 소켓이 사용중인 포트 확인하기 2021.02.09 댓글 0 + 이전 댓글 더보기