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 Feb 13, 2021
1 parent 7da285b commit 4cca0d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions resources/lib/modules/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,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 @@ -446,8 +447,8 @@ def do_backup(self, listItem=None):
self.backup_dlg.create('LibreELEC', oe._(32375))
if not os.path.exists(self.BACKUP_DESTINATION):
os.makedirs(self.BACKUP_DESTINATION)
self.backup_file = oe.timestamp() + '.tar'
tar = tarfile.open(bckDir + self.backup_file, 'w')
self.backup_file = f'{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 4cca0d4

Please sign in to comment.