{"id":15650470,"url":"https://github.com/kasparsd/photos-sync","last_synced_at":"2025-04-30T17:02:37.905Z","repository":{"id":87332949,"uuid":"48608020","full_name":"kasparsd/photos-sync","owner":"kasparsd","description":"Sync OS X Photos to Anywhere (NAS, Dropbox, Amazon S3 or Glacier, Backblaze B2)","archived":false,"fork":false,"pushed_at":"2017-12-26T13:44:49.000Z","size":49,"stargazers_count":35,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T17:02:16.589Z","etag":null,"topics":["macos","photos","rsync","symlink"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kasparsd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-26T11:09:18.000Z","updated_at":"2022-08-25T00:59:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1a8d2c4-618e-4237-a228-14566e8eb129","html_url":"https://github.com/kasparsd/photos-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasparsd%2Fphotos-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasparsd%2Fphotos-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasparsd%2Fphotos-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasparsd%2Fphotos-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kasparsd","download_url":"https://codeload.github.com/kasparsd/photos-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748934,"owners_count":21637414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["macos","photos","rsync","symlink"],"created_at":"2024-10-03T12:34:45.167Z","updated_at":"2025-04-30T17:02:37.180Z","avatar_url":"https://github.com/kasparsd.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sync and Backup OS X Photos to Any Location\n\n![Screenshot of a synchronized Photos folder](https://raw.githubusercontent.com/kasparsd/photos-sync/master/screenshot.png)\n\nA script that creates a folder with symbolic links (symlinks) to all of the OS X Photos originals which can be _rsynced_ to any location. I use it to share all my photos with the rest of the family using a shared WD EX2 drive. This allows me to avoid adding everything to the Family shared album on iCloud Photos.\n\n\t$ git clone https://github.com/kasparsd/photos-sync.git\n\t$ php photos-sync/symlink-photos.php\n\nIt reads the OS X Photos database (SQLite) at `~/Pictures/Photos Library.photoslibrary/database/Library.apdb` (a copy of it) and creates symlinks to all original photos and videos in the `photos-sync/links` folder organized by month and filenames prepended with an `md5` hash of the file path to avoid collisions.\n\nIt can then be sent to any location using rsync or any other tool of preference. Here is a sample bash script which could be added to cron:\n\n\t#!/bin/bash\n\n\t# Ensure that we're always relative to the current directory\n\tcd \"$(dirname \"$0\")\"\n\n\t# Symlink photos and rsync to the network share\n\tphp symlink-photos.php\n\n\t# Mount the network share\n\tmount_afp afp://western.local/Public /Volumes/Public\n\n\t# Resolve and synchronize symlinks to the network share\n\trsync -avL links/ /Volumes/Public/Photos\n\nwhere `-L` ensures that rsync resolves the symlinks.\n\nRun it every hour via cron `crontab -e`:\n\n\t30 * * * * pgrep -f sync.sh || /path/to/sync.sh\n\nwhere `pgrep -f sync.sh` will ensure that no other sync process is in progress.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasparsd%2Fphotos-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkasparsd%2Fphotos-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasparsd%2Fphotos-sync/lists"}