diff --git a/share/actionsmap.yml b/share/actionsmap.yml index 9d5c76b01..70f80e463 100755 --- a/share/actionsmap.yml +++ b/share/actionsmap.yml @@ -1201,7 +1201,7 @@ backup: api: PUT /backups//restore arguments: name: - help: Name of the local backup archive + help: Name or path of the backup archive --system: help: List of system parts to restore (or all if none is given) nargs: "*" @@ -1232,7 +1232,7 @@ backup: api: GET /backups/ arguments: name: - help: Name of the local backup archive + help: Name or path of the backup archive -d: full: --with-details help: Show additional backup information diff --git a/src/backup.py b/src/backup.py index 58439189d..0f0f9a7e0 100644 --- a/src/backup.py +++ b/src/backup.py @@ -2314,11 +2314,6 @@ def backup_restore(name, system=[], apps=[], force=False): # Initialize # # - if name.endswith(".tar.gz"): - name = name[: -len(".tar.gz")] - elif name.endswith(".tar"): - name = name[: -len(".tar")] - restore_manager = RestoreManager(name) restore_manager.set_system_targets(system) @@ -2451,6 +2446,7 @@ def backup_info(name, with_details=False, human_readable=False): human_readable -- Print sizes in human readable format """ + original_name = name if name.endswith(".tar.gz"): name = name[: -len(".tar.gz")] @@ -2463,7 +2459,10 @@ def backup_info(name, with_details=False, human_readable=False): if not os.path.lexists(archive_file): archive_file += ".gz" if not os.path.lexists(archive_file): - raise YunohostValidationError("backup_archive_name_unknown", name=name) + # Maybe the user provided a path to the backup? + archive_file = original_name + if not os.path.lexists(archive_file): + raise YunohostValidationError("backup_archive_name_unknown", name=name) # If symlink, retrieve the real path if os.path.islink(archive_file):