Skip to content

Commit

Permalink
Compress backup tarballs with gzip
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Leonard <[email protected]>
  • Loading branch information
antonlacon committed Jun 29, 2020
1 parent 5a4a59d commit 67bc6da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/resources/lib/modules/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,8 @@ def do_backup(self, listItem=None):
'',
False,
False,
self.BACKUP_DESTINATION )
self.BACKUP_DESTINATION,
False )

if bckDir and os.path.exists(bckDir):
# free space check
Expand All @@ -561,8 +562,8 @@ def do_backup(self, listItem=None):
self.backup_dlg.create('LibreELEC', self.oe._(32375))
if not os.path.exists(self.BACKUP_DESTINATION):
os.makedirs(self.BACKUP_DESTINATION)
self.backup_file = self.oe.timestamp() + '.tar'
tar = tarfile.open(bckDir + self.backup_file, 'w')
self.backup_file = self.oe.timestamp() + '.tar.gz'
tar = tarfile.open(bckDir + self.backup_file, 'w:gz', compresslevel=1)
for directory in self.BACKUP_DIRS:
self.tar_add_folder(tar, directory)
tar.close()
Expand Down

0 comments on commit 67bc6da

Please sign in to comment.