From cda5bc56ae4c4ab58910b65f4f3bc064541dca09 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Wed, 13 Aug 2025 17:52:33 +0100 Subject: [PATCH] infra: add s3 upload script --- scripts/purge_images.sh | 15 --------------- scripts/upload_images_to_s3.sh | 6 ++++++ 2 files changed, 6 insertions(+), 15 deletions(-) delete mode 100755 scripts/purge_images.sh create mode 100755 scripts/upload_images_to_s3.sh diff --git a/scripts/purge_images.sh b/scripts/purge_images.sh deleted file mode 100755 index a394e6c..0000000 --- a/scripts/purge_images.sh +++ /dev/null @@ -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 - diff --git a/scripts/upload_images_to_s3.sh b/scripts/upload_images_to_s3.sh new file mode 100755 index 0000000..92b612a --- /dev/null +++ b/scripts/upload_images_to_s3.sh @@ -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/