infra: add s3 upload script
This commit is contained in:
parent
c476cab7d0
commit
cda5bc56ae
2 changed files with 6 additions and 15 deletions
|
@ -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
6
scripts/upload_images_to_s3.sh
Executable 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/
|
Loading…
Add table
Reference in a new issue