Add icloud script

This commit is contained in:
Alex Hyett 2024-09-13 14:41:31 +01:00
parent 11e5b41784
commit 0ada1aa767
2 changed files with 37 additions and 4 deletions

View file

@ -12,7 +12,8 @@ A collection of useful scripts that I use everyday.
- `copyfiles.sh` - Same as the above but it copies instead of moves the files. [Notes](https://www.alexhyett.com/notes/moving-files-with-rsync/) - `copyfiles.sh` - Same as the above but it copies instead of moves the files. [Notes](https://www.alexhyett.com/notes/moving-files-with-rsync/)
- `slackit.sh` - I use this to easily send slack notifications to myself from inside other scripts. [Notes](https://www.alexhyett.com/notes/send-slack-messages-with-a-command/) - `slackit.sh` - I use this to easily send slack notifications to myself from inside other scripts. [Notes](https://www.alexhyett.com/notes/send-slack-messages-with-a-command/)
- `sort_photos.py` - This file moves photos in my camera uploads folder into my main photos folder based on the date the photo was taken. [Notes](https://www.alexhyett.com/notes/sorting-photos-into-folders/) - `sort_photos.py` - This file moves photos in my camera uploads folder into my main photos folder based on the date the photo was taken. [Notes](https://www.alexhyett.com/notes/sorting-photos-into-folders/)
- `down.sh` - Runs `docker-compose down` on in all the nested folders under `directory` [Notes](https://www.alexhyett.com/notes/docker-scripts-for-nested-folders/) - `down.sh` - Runs `docker-compose down` on in all the nested folders under `directory`. [Notes](https://www.alexhyett.com/notes/docker-scripts-for-nested-folders/)
- `up.sh` - Runs `docker-compose up -d` on in all the nested folders under `directory` [Notes](https://www.alexhyett.com/notes/docker-scripts-for-nested-folders/) - `up.sh` - Runs `docker-compose up -d` on in all the nested folders under `directory`. [Notes](https://www.alexhyett.com/notes/docker-scripts-for-nested-folders/)
- `stop.sh` - Runs `docker-compose stop` on in all the nested folders under `directory` [Notes](https://www.alexhyett.com/notes/docker-scripts-for-nested-folders/) - `stop.sh` - Runs `docker-compose stop` on in all the nested folders under `directory`. [Notes](https://www.alexhyett.com/notes/docker-scripts-for-nested-folders/)
- `start.sh` - Runs `docker-compose start` on in all the nested folders under `directory` [Notes](https://www.alexhyett.com/notes/docker-scripts-for-nested-folders/) - `start.sh` - Runs `docker-compose start` on in all the nested folders under `directory`. [Notes](https://www.alexhyett.com/notes/docker-scripts-for-nested-folders/)
- `icloud_download.sh` - I use this to download my iCloud photos. [Notes](https://www.alexhyett.com/notes/download-photos-from-icloud/)

32
icloud_download.sh Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"
# Import variables
set -a
source .env
set +a
VERSION=1.23.0
FILE=icloudpd-$VERSION-linux-amd64
if [ ! -f $FILE ]; then
echo "icloudpd missing, downloading"
wget https://github.com/icloud-photos-downloader/icloud_photos_downloader/releases/download/v$VERSION/icloudpd-$VERSION-linux-amd64
chmod +x $FILE
fi
echo "Syncing iCloud Photos"
./$FILE --directory $PHOTO_FOLDER \
--username "$APPLE_EMAIL" \
--password "$APPLE_PASSWORD" \
--library "$APPLE_LIBRARY" \
--recent 500 \
--until-found 10 \
--set-exif-datetime \
--folder-structure none \
--file-match-policy name-size-dedup-with-suffix \
--skip-live-photos
echo "Completed Syncing iCloud Photos"