Skip to content

Instantly share code, notes, and snippets.

@apsun
Last active November 21, 2023 20:16
Show Gist options
  • Select an option

  • Save apsun/e9aa4283d879fdfc7459082e53c8b0f2 to your computer and use it in GitHub Desktop.

Select an option

Save apsun/e9aa4283d879fdfc7459082e53c8b0f2 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Sync photos from iPhone to Linux using libimobiledevice + ifuse
set -euo pipefail
if [ $# -ne 1 ]; then
echo "usage: $0 <dest dir>"
exit 1
fi
mnt="$(mktemp -d)"
ifuse "${mnt}"
rsync --exclude=".*" --archive --progress --inplace "${mnt}/DCIM/." "$1"
fusermount -u "${mnt}"
rmdir "${mnt}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment