A tool to take control of backing up your iOS device to your own server via Wi-Fi or USB.
- Run this to start the avahi daemon:
systemctl start avahi-daemon.service
# TODO: install how to - Initialize:
- Add a destination backup drive to a new file in the repo root,
config.sh
, by basing the file off a copy of the one intemplate
folder made with:cp template/config.sh ./
and then editing the copy. You should enter in something like/mnt/yourDriveMountPointHere/home
, where the/mnt/yourDriveMountPointHere
part can be anything as long as it is a valid mountpoint (mountpoint /mnt/yourDriveMountPointHere
should return an exit code of 0). - In the destination backup drive mentioned above, make a new folder called
home
. sudo groupadd iosbackup
to make theiosbackup
group- Make a user just for usbmuxd in the
iosbackup
group:sudo useradd iosbackup_usbmuxd
sudo usermod -a -G iosbackup iosbackup_usbmuxd
- Give the users in the
iosbackup
group permission to runusbmuxd
under the account created above by editing/etc/sudoers
if you're not on NixOS, or by addingsecurity.sudo.configFile = '' Config strings go here ''
to your NixOS config at/etc/nixos/configuration.nix
if you are on NixOS, to add the following line:%iosbackup ALL=(iosbackup_usbmuxd)NOPASSWD:ALL USBMUXD_FILEPATH
whereUSBMUXD_FILEPATH
is something like/nix/store/zsmdrh44nl59v6db340j7w81cg77ys8v-usbmuxd2-753b79eaf317c56df6c8b1fb6da5847cc54a0bb0/bin/usbmuxd
which you get from doingwhich usbmuxd
when in thenix-shell
present in this repo root. This limits the groupiosbackup
to, when running sudo, only be able to run theusbmuxd
command as the useriosbackup_usbmuxd
. - If on NixOS, reload your config using
sudo nixos-rebuild switch
to apply the sudoers change above.
sudo useradd UserNameHere
to create userUserNameHere
(replace this with a new user name to make backups under). Make as many users as desired.sudo usermod -a -G iosbackup UserNameHere
to addUserNameHere
to theiosbackup
group. Do this for all the users added in the previous step.- First-time setup
- Plug the device in to the computer via USB
sudo ./backupMyIPhone.sh '' 1 1 0
, note the UDID from the output- Enter passcode and "Trust this computer" on the device
- Add your device UDID (shows in the output from the above
./backupMyIPhone.sh
command) to a new file in the repo root,udidToFolderLookupTable.py
, by basing the file off a copy of the one intemplate
folder made with:cp template/udidToFolderLookupTable.py ./
and then editing the copy. sudo ./backupMyIPhone.sh '' 1 1 0 YourDeviceUDIDHere
(whereYourDeviceUDIDHere
is the UDID you saw) to perform first-time setup. This requires the device to be connected via USB.sudo pkill usbmuxd
at the end.
- Add a destination backup drive to a new file in the repo root,
sudo -E su --preserve-environment UserNameHere
(whereUserNameHere
is a user created above) and then run one of the following in this shell to make a backup. The following commands don't require the device to be connected to the computer via USB, only to be plugged in and charging somewhere on the same local WiFi network.- Run these as sudo the first time (as any user), then run them in the shell created above afterwards if needed:
- To backup immediately once if it can connect and also repeating every day -- not dry run:
./backupMyIPhone.sh '' 1 0 0 'YourDeviceUDIDHere'
- Or: to backup immediately once if it can connect and also repeating every day -- dry run:
./backupMyIPhone.sh '' 1 0 1 'YourDeviceUDIDHere'
- Or: to backup via USB instead (it will start usbmuxd as root with sudo):
- Run without the
sudo -E su --preserve-environment UserNameHere
shell mentioned above:./backupMyIPhone.sh "" 1 0 0 'YourDeviceUDIDHere' 0 1 ./shell_new_libimobiledevice.nix
(last argument is optional; it provides a Nix shell that has a newer libusbmuxd version of your choice)
- Run without the
- To backup immediately once if it can connect and also repeating every day -- not dry run:
- Run these as sudo the first time (as any user), then run them in the shell created above afterwards if needed:
- Run
./ibackup.sh
(with additional arguments like the above) for as many users as needed to make the backup daemons for each user. (They should all end up sharing the same usbmuxd instance.)
- Debug how usb/WiFi connections are doing:
nix-shell
, thensudo usbmuxd -vv --debug --debug
Nvm:
- Internal:
sudo ./ibackup.sh '' 1 0 8089 UserNameHere
to perform first-time setup. This requires the device to be connected via USB. - Internal: to backup as a daemon running now, which will additionally run at 12:01 AM or 24 hours from now, whichever is closest, repeatedly:
./ibackup.sh YourDeviceUDIDHere 0 0 8089 UserNameHere
whereYourDeviceUDIDHere
is the device UDID from the output of the first-time setup above, andUserNameHere
is a user created above.
- Run a backup "daemon":
sudo su YourBackupUserHere -c "./backupMyIPhone.sh '' 1 0 1 'YourDeviceUDIDHere'"
whereYourBackupUserHere
is in theiosbackup
group.