summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-09-21 01:46:56 +0200
committerGravatar Martin Szulecki2013-09-21 01:46:56 +0200
commit0eaa1c53598054ec586108f2dec8b391dc0ac473 (patch)
treeefb13eb5a366b31d1fe76b11e411df51ffc73928 /tools
parented1721776aa1be92f8e4ce51f2fec679b5a91100 (diff)
downloadlibimobiledevice-0eaa1c53598054ec586108f2dec8b391dc0ac473.tar.gz
libimobiledevice-0eaa1c53598054ec586108f2dec8b391dc0ac473.tar.bz2
idevicebackup2: Add argument to enforce a full backup from device
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicebackup2.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 1aa03f5..47de171 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -87,7 +87,8 @@ enum cmd_flags {
CMD_FLAG_RESTORE_REMOVE_ITEMS = (1 << 5),
CMD_FLAG_ENCRYPTION_ENABLE = (1 << 6),
CMD_FLAG_ENCRYPTION_DISABLE = (1 << 7),
- CMD_FLAG_ENCRYPTION_CHANGEPW = (1 << 8)
+ CMD_FLAG_ENCRYPTION_CHANGEPW = (1 << 8),
+ CMD_FLAG_FORCE_FULL_BACKUP = (1 << 9)
};
static int backup_domain_changed = 0;
@@ -1258,6 +1259,7 @@ static void print_usage(int argc, char **argv)
printf("Create or restore backup from the current or specified directory.\n\n");
printf("commands:\n");
printf(" backup\tcreate backup for the device\n");
+ printf(" --full\t\tforce full backup from device.\n");
printf(" restore\trestore last backup to the device\n");
printf(" --system\t\trestore system files, too.\n");
printf(" --reboot\t\treboot the system when done.\n");
@@ -1375,6 +1377,9 @@ int main(int argc, char *argv[])
backup_password = strdup(argv[i]);
continue;
}
+ else if (!strcmp(argv[i], "--full")) {
+ cmd_flags |= CMD_FLAG_FORCE_FULL_BACKUP;
+ }
else if (!strcmp(argv[i], "info")) {
cmd = CMD_INFO;
verbose = 0;
@@ -1723,6 +1728,11 @@ checkpoint:
plist_free(info_plist);
info_plist = NULL;
+ if (cmd_flags & CMD_FLAG_FORCE_FULL_BACKUP) {
+ PRINT_VERBOSE(1, "Enforcing full backup from device.\n");
+ opts = plist_new_dict();
+ plist_dict_insert_item(opts, "ForceFullBackup", plist_new_bool(1));
+ }
/* request backup from device with manifest from last backup */
if (willEncrypt) {
PRINT_VERBOSE(1, "Backup will be encrypted.\n");
@@ -1730,7 +1740,9 @@ checkpoint:
PRINT_VERBOSE(1, "Backup will be unencrypted.\n");
}
PRINT_VERBOSE(1, "Requesting backup from device...\n");
- err = mobilebackup2_send_request(mobilebackup2, "Backup", udid, source_udid, NULL);
+ err = mobilebackup2_send_request(mobilebackup2, "Backup", udid, source_udid, opts);
+ if (opts)
+ plist_free(opts);
if (err == MOBILEBACKUP2_E_SUCCESS) {
if (is_full_backup) {
PRINT_VERBOSE(1, "Full backup mode.\n");