ROBOCOPY the iOS-Backup

10 01 2013

You can backup your iOS-Devices on iCloud.
If you additionally use iTunes you may want to transfer the complete iTunes-Backup of your devices to another location.

For Windows Vista/7/8-Computers there is a powerful helper app shipped with Windows that can sync one location with another in one direction (source to destination). It’s called ROBOCOPY.exe.

Robocopy, or ‘Robust File Copy’, is a command-line directory replication command. It has been available as part of the Windows Resource Kit starting with Windows NT 4.0, and was introduced as a standard feature of Windows Vista, Windows 7/8 and Windows Server 2008. The command is robocopy.

Features of ROBOCOPY …

  • Ability to tolerate network interruptions and resume copying. (incomplete files are marked with a date stamp of 1980-01-01 and contain a recovery record so Robocopy knows where to continue from)
  • Ability to skip Junction Points which can cause to fail copying in an infinite loop (/XJ)
  • Ability to copy file data and attributes correctly, and to preserve original timestamps, as well as NTFS ACLs, owner information, and audit information using command line switches. (/COPYALL or /COPY:) Copying folder timestamps is also possible in later versions (/DCOPY:T).
    Access control list (ACL), with respect to a computer file system, is a list of permissions attached to an object. An ACL specifies which users or system processes are granted access to objects, as well as what operations are allowed on given objects
  • Ability to assert the Windows NT ‘backup right’ (/B) so an administrator may copy an entire directory, including files denied readability to the administrator.
  • Persistence by default, with a programmable number of automatic retries if a file cannot be opened.
  • A ‘mirror’ mode, which keeps trees in sync by optionally deleting files out of the destination that are no longer present in the source.
  • Ability to skip files that already appear in the destination folder with identical size and timestamp.
  • A continuously updated command-line progress indicator.
  • Ability to copy file and folder names exceeding 256 characters on to a theoretical limit of 32,000 characters without errors.
  • Return code on program termination for batch file usage.

The BATCH-File …

Use this BATCH-File with ROBOCOPY-Commands to do the job.

robocopy "c:\Users\%1\AppData\Local\Apple" "%2:\ios-backup" /mir /purge /tee /log+:c:\Users\%1\AppData\Local\Apple\ROBOCOPY-IOS-DEVICE.log /np
robocopy "c:\Users\%1\AppData\Roaming\Apple Computer" "%2:\ios-backup" /mir /purge /tee /log+:c:\Users\%1\AppData\Local\Apple\ROBOCOPY-IOS-DEVICE.log /np

Add these lines to the BATCH-File if you need some help.

@echo off
echo -------------------------------------------------------------
echo Microsoft ROBOCOPY for transferring iOS-Backups to a location
echo .
echo 2012-12-21 by
echo -------------------------------------------------------------
rem Windows 7 .......................... Some ROBOCOPY Parameters
rem /MIR Mirrors a directory tree
rem /PURGE Deletes destination files/directorys not in source
rem /XD Excludes directories matching specifies names/paths
rem /tee Write status output to console window+log file
rem /log: Write status output to the log file
rem /np no progress (%-Fortschritt nicht anzeigen, loggen)
rem /XD set this parameter for drive mirroring
rem "g:\RECYCLER"
rem "l:\$RECYCLE.BIN"
rem "g:\WindowsImageBackup"
rem "g:\System Volume Information"
rem -------------------------------------------------------------
rem Parameter %1 .......................... your Windows username
rem %2 .......................... the destination drive
rem -------------------------------------------------------------

The BATCH-File uses two parameters %1 and %2.
Either you modify the file by filling in your Windows username and the destination drive or you start the BATCH-File with the command
ROBOCOPY-IOS-DEVICE.bat username destination
e.g. ROBOCOPY-IOS-DEVICE.bat inotes4you d where d is the drive letter for the destination drive.


Notes and some stats …

Crash Reporter
While robocopying an iOS-Backup you may see files with extension .crash.
When an application stops functioning properly or crashes on an iOS device, a ‘Crash Report” is created and stored on the device. Crash reports describe the conditions under which the application terminated, in most cases including a complete stack trace for each executing thread, and are typically very useful for debugging issues in the application.

Then each time you sync your iPhone to a Mac or Windows computer, iTunes transfers the crash log content to your local hard drive. You can locate individual crash log files on your computer and delete them in order to free space on your hard drive and device.

Navigate to the
directory. Delete all files and sync your device via iTunes.

Some stats
The referred devices in the screenshots are an iPhone 4S (64 GB, 13.5 GB used by apps and data) and an iPad 3 (64 GB, 16.7 GB used).
The complete backup of these two devices is 3.95 GB.
The logs\CrashReporter\MobileDevice\… folder contains 4,113 files with 95,1 MB.
The overall number of files of the two device backups is 15,636.



%d bloggers like this: