summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2011-04-27 22:37:07 +0200
committerGravatar Martin Szulecki2011-04-27 22:37:07 +0200
commit9f59aa35933f16e893ae31551c19a57744aa9d8a (patch)
tree959d37418199b128b556578e52f4ec5c140e663e
parent8dd59522c788332a54fa85bee2ae3d0d7fee01b0 (diff)
downloadlibimobiledevice-9f59aa35933f16e893ae31551c19a57744aa9d8a.tar.gz
libimobiledevice-9f59aa35933f16e893ae31551c19a57744aa9d8a.tar.bz2
idevicebackup2: Implement UNBACK command to unpack a backup into filesystem
-rw-r--r--tools/idevicebackup2.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index c443826..8ad8355 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -62,6 +62,7 @@ enum cmd_mode {
CMD_RESTORE,
CMD_INFO,
CMD_LIST,
+ CMD_UNBACK,
CMD_LEAVE
};
@@ -1068,7 +1069,8 @@ static void print_usage(int argc, char **argv)
printf(" backup\tcreate backup for the device\n");
printf(" restore\trestore last backup to the device\n");
printf(" info\t\tshow details about last completed backup of device\n");
- printf(" list\t\tlist files of last completed backup in CSV format\n\n");
+ printf(" list\t\tlist files of last completed backup in CSV format\n");
+ printf(" unback\tUnpack a completed backup in DIRECTORY/_unback_/\n\n");
printf("options:\n");
printf(" -d, --debug\t\tenable communication debugging\n");
printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n");
@@ -1130,6 +1132,9 @@ int main(int argc, char *argv[])
cmd = CMD_LIST;
verbose = 0;
}
+ else if (!strcmp(argv[i], "unback")) {
+ cmd = CMD_UNBACK;
+ }
else if (backup_directory == NULL) {
backup_directory = argv[i];
}
@@ -1395,6 +1400,14 @@ checkpoint:
cmd = CMD_LEAVE;
}
break;
+ case CMD_UNBACK:
+ PRINT_VERBOSE(1, "Starting to unpack backup...\n");
+ err = mobilebackup2_send_request(mobilebackup2, "Unback", uuid, NULL, NULL);
+ if (err != MOBILEBACKUP2_E_SUCCESS) {
+ printf("Error requesting unback operation from device, error code %d\n", err);
+ cmd = CMD_LEAVE;
+ }
+ break;
default:
break;
}