Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressed backups and wider range of restores #162

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 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 All @@ -462,10 +463,12 @@ def do_restore(self, listItem=None):
restore_file_path = xbmcDialog.browse( 1,
oe._(32373),
'files',
'??????????????.tar',
'.tar|.tar.gz|.tar.bz2|.tar.xz',
False,
False,
self.BACKUP_DESTINATION )
self.BACKUP_DESTINATION,
False )

# Do nothing if the dialog is cancelled - path will be the backup destination
if not os.path.isfile(restore_file_path):
return
Expand Down