infra: add s3 upload script

This commit is contained in:
Thomas Bishop 2025-08-13 17:52:33 +01:00
parent c476cab7d0
commit cda5bc56ae
2 changed files with 6 additions and 15 deletions

View file

@ -1,15 +0,0 @@
##!/bin/bash
# If there are images in img/ that are not being used by the Zettelkasten, delete them
# Loop through /img directory
find "/home/thomas/repos/eolas/img" -type f | while read filename; do
# Check each .md file in ZK for image
search_result=$(rg "${filename##*/}" "${EOLAS_PATH}/zk" --type markdown)
# If the image is not found in any file, delete it
if [ -z "$search_result" ]; then
echo "Deleted unused image: ${filename##*/}"
rm $filename
fi
done

6
scripts/upload_images_to_s3.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
aws --profile garage --endpoint-url https://s3.systemsobscure.net s3 sync "$(pwd)/img/" s3://eolas/
## List current images in bucket:
# aws --profile garage --endpoint-url https://s3.systemsobscure.net s3 ls s3://eolas/