Created
August 23, 2013 21:41
-
-
Save jackmaney/6324323 to your computer and use it in GitHub Desktop.
Tarballing a directory in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tarfile | |
dir = "/some/directory" | |
tar = tarfile.open(dir + "/some_file.tar.gz",'w:gz') | |
tar.add(dir + "/some_subdirectory",arcname='some_subdirectory') | |
tar.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment