icloud-photos-backup icon indicating copy to clipboard operation
icloud-photos-backup copied to clipboard

a tool to backup your photos from iCloud

⚠️ Archived, use icloud-photos-downloader ⚠️

iCloud Photos backup

Security Scanning Docker Image CI Duplicated Lines (%) Reliability Rating Quality Gate Status Technical Debt Lines of Code Code Smells Maintainability Rating Security Rating Bugs Vulnerabilities Known Vulnerabilities

a tool to backup your photos from iCloud

Like many others I keep all my family photos in Photos and take comfort that Apple handle the storage + backup.

However something got me worried, what if I got infected with some ransomware that encrypted or destroyed my photos, from an attack point of view, that'd probably be a pretty lucrative attack.

Or what if the pictures I have of my kids were misclassified by a well intentioned Apple and I lost access to the originals like this guy did with his google life.

Usage

mkdir -p session keyring photos
### Get or renew a login session with 2FA

docker run \
  --rm -ti \
  -v ${PWD}/session:/tmp/pyicloud \
  -v ${PWD}/keyring:/home/app/.local/share/python_keyring \
  -e USERNAME="[email protected]" \
  ghcr.io/chrisns/icloud-photos-backup

# If it works this should start downloading photos, but they're only going to a docker volume, not to your host machine to ^C to exit

docker run \
  --name photobackup \
  -d \
  -v ${PWD}/backup:/app/photos \
  -v ${PWD}/keyring:/home/app/.local/share/python_keyring \
  -v ${PWD}/session:/tmp/pyicloud \
  -e USERNAME="[email protected]" \
  ghcr.io/chrisns/icloud-photos-backup

# you can follow the logs to see progress, initial backup could take a LONG time (days-weeks)
docker logs -f photobackup

# you can then maybe add a cron job to do:

docker start -a photobackup

But I don't trust you @chrisns with my credentials

No, why on earth would you, you'd be mad to blindly run the above docker command, so I'd really urge you to pull this repo, check all the dependencies and use very much at your own discretion.

My target intention is to personally run this on an isolated Raspberry pi with no remote access, and just enough network to talk to iCloud and also syslog so I can observe errors and manually fix.