diff options
author | Martin Szulecki | 2012-11-29 17:11:27 +0100 |
---|---|---|
committer | Martin Szulecki | 2012-11-29 17:11:27 +0100 |
commit | 37401693ad6547e4ea272e8419ab8995230c3fed (patch) | |
tree | a689af40a31d1fe3d2843e5c04629ea2f55d2503 /tools | |
parent | ed47413660eb3f49e55b795513990269491ad0c7 (diff) | |
download | libimobiledevice-37401693ad6547e4ea272e8419ab8995230c3fed.tar.gz libimobiledevice-37401693ad6547e4ea272e8419ab8995230c3fed.tar.bz2 |
idevicebackup2: Add flag to remove items not being restored from target device
Diffstat (limited to 'tools')
-rw-r--r-- | tools/idevicebackup2.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 7256ee9..eeb2718 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c @@ -85,7 +85,8 @@ enum cmd_flags { CMD_FLAG_RESTORE_SYSTEM_FILES = (1 << 1), CMD_FLAG_RESTORE_REBOOT = (1 << 2), CMD_FLAG_RESTORE_COPY_BACKUP = (1 << 3), - CMD_FLAG_RESTORE_SETTINGS = (1 << 4) + CMD_FLAG_RESTORE_SETTINGS = (1 << 4), + CMD_FLAG_RESTORE_REMOVE_ITEMS = (1 << 5) }; static void notify_cb(const char *notification, void *userdata) @@ -1119,6 +1120,7 @@ static void print_usage(int argc, char **argv) printf(" --reboot\treboot the system when done.\n"); printf(" --copy\tcreate a copy of backup folder before restoring.\n"); printf(" --settings\trestore device settings from the backup.\n"); + printf(" --remove\tremove items which are not being restored\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"); printf(" unback\tunpack a completed backup in DIRECTORY/_unback_/\n\n"); @@ -1201,6 +1203,9 @@ int main(int argc, char *argv[]) else if (!strcmp(argv[i], "--settings")) { cmd_flags |= CMD_FLAG_RESTORE_SETTINGS; } + else if (!strcmp(argv[i], "--remove")) { + cmd_flags |= CMD_FLAG_RESTORE_REMOVE_ITEMS; + } else if (!strcmp(argv[i], "info")) { cmd = CMD_INFO; verbose = 0; @@ -1463,7 +1468,10 @@ checkpoint: plist_dict_insert_item(opts, "RestoreDontCopyBackup", plist_new_bool(1)); PRINT_VERBOSE(1, "Don't copy backup: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_COPY_BACKUP) == 0 ? "Yes":"No")); plist_dict_insert_item(opts, "RestorePreserveSettings", plist_new_bool((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0)); - PRINT_VERBOSE(1, "Preserve settings of device: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0 ? "Yes":"No")); + PRINT_VERBOSE(1, "Preserve settings of device: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0 ? "Yes":"No")); + if (cmd_flags & CMD_FLAG_RESTORE_REMOVE_ITEMS) + plist_dict_insert_item(opts, "RemoveItemsNotRestored", plist_new_bool(1)); + PRINT_VERBOSE(1, "Remove items that are not restored: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_REMOVE_ITEMS) ? "Yes":"No")); err = mobilebackup2_send_request(mobilebackup2, "Restore", udid, source_udid, opts); plist_free(opts); |