summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup2.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicebackup2.c')
-rw-r--r--tools/idevicebackup2.c58
1 files changed, 44 insertions, 14 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index bfb84c6..9d7c5fc 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -1444,8 +1444,8 @@ checkpoint:
1444 } 1444 }
1445 1445
1446 if (cmd != CMD_LEAVE) { 1446 if (cmd != CMD_LEAVE) {
1447 /* reset backup status */ 1447 /* reset operation success status */
1448 int backup_ok = 0; 1448 int operation_ok = 0;
1449 plist_t message = NULL; 1449 plist_t message = NULL;
1450 1450
1451 char *dlmsg = NULL; 1451 char *dlmsg = NULL;
@@ -1600,7 +1600,7 @@ checkpoint:
1600 plist_get_uint_val(nn, &ec); 1600 plist_get_uint_val(nn, &ec);
1601 error_code = (uint32_t)ec; 1601 error_code = (uint32_t)ec;
1602 if (error_code == 0) { 1602 if (error_code == 0) {
1603 backup_ok = 1; 1603 operation_ok = 1;
1604 } 1604 }
1605 } 1605 }
1606 nn = plist_dict_get_item(node_tmp, "ErrorDescription"); 1606 nn = plist_dict_get_item(node_tmp, "ErrorDescription");
@@ -1660,20 +1660,50 @@ files_out:
1660 } 1660 }
1661 } while (1); 1661 } while (1);
1662 1662
1663 if (cmd == CMD_BACKUP) { 1663 /* report operation status to user */
1664 PRINT_VERBOSE(1, "Received %d files from device.\n", file_count); 1664 switch (cmd) {
1665 if (mb2_status_check_snapshot_state(backup_directory, uuid, "finished")) { 1665 case CMD_BACKUP:
1666 PRINT_VERBOSE(1, "Backup Successful.\n"); 1666 PRINT_VERBOSE(1, "Received %d files from device.\n", file_count);
1667 } else { 1667 if (mb2_status_check_snapshot_state(backup_directory, uuid, "finished")) {
1668 if (quit_flag) { 1668 PRINT_VERBOSE(1, "Backup Successful.\n");
1669 PRINT_VERBOSE(1, "Backup Aborted.\n");
1670 } else { 1669 } else {
1671 PRINT_VERBOSE(1, "Backup Failed.\n"); 1670 if (quit_flag) {
1671 PRINT_VERBOSE(1, "Backup Aborted.\n");
1672 } else {
1673 PRINT_VERBOSE(1, "Backup Failed.\n");
1674 }
1672 } 1675 }
1676 break;
1677 case CMD_UNBACK:
1678 if (quit_flag) {
1679 PRINT_VERBOSE(1, "Unback Aborted.\n");
1680 } else {
1681 PRINT_VERBOSE(1, "The files can now be found in the \"_unback_\" directory.\n");
1682 PRINT_VERBOSE(1, "Unback Successful.\n");
1673 } 1683 }
1674 } else if (cmd == CMD_RESTORE) { 1684 break;
1675 // TODO: check for success/failure 1685 case CMD_RESTORE:
1676 PRINT_VERBOSE(1, "The device should reboot now to complete the process.\nRestore Successful.\n"); 1686 if (cmd_flags & CMD_FLAG_RESTORE_REBOOT)
1687 PRINT_VERBOSE(1, "The device should reboot now.\n");
1688 if (operation_ok) {
1689 PRINT_VERBOSE(1, "Restore Successful.\n");
1690 } else {
1691 PRINT_VERBOSE(1, "Restore Failed.\n");
1692 }
1693
1694 break;
1695 case CMD_INFO:
1696 case CMD_LIST:
1697 case CMD_LEAVE:
1698 default:
1699 if (quit_flag) {
1700 PRINT_VERBOSE(1, "Operation Aborted.\n");
1701 } else if (cmd == CMD_LEAVE) {
1702 PRINT_VERBOSE(1, "Operation Failed.\n");
1703 } else {
1704 PRINT_VERBOSE(1, "Operation Successful.\n");
1705 }
1706 break;
1677 } 1707 }
1678 } 1708 }
1679 if (lockfile) { 1709 if (lockfile) {