Commit 678bc47
chasinglightning
·
2025-05-11 16:47:33 -0400 EDT
parent 0e927ff
add tinypin log
1 files changed,
+24,
-0
+24,
-0
| ... | ... | @@ -0,0 +1,24 @@ | |
| 1 | + | #!/bin/bash | |
| 2 | + | # | |
| 3 | + | # i use this to check on the files uploaded to my tinypin instance regularly | |
| 4 | + | # because tinypin has no admin dashboard or whatever | |
| 5 | + | # use the extract cmd provided at the end or else u get ugly empty folders | |
| 6 | + | ||
| 7 | + | basedir="/mnt/tank/tinypin-data/images" | |
| 8 | + | WD="/home/kat/tinypin-log" | |
| 9 | + | now=$(date "+%Y-%m-%d") | |
| 10 | + | ||
| 11 | + | cd ${WD} && mkdir -p ${WD}/${now} | |
| 12 | + | ||
| 13 | + | newdir=$(echo "${WD}/${now}") | |
| 14 | + | ||
| 15 | + | for f in *.jpg *.JPG *.jpeg *.png *.webp *.gif; do | |
| 16 | + | cd ${basedir} && find . -type f -not -path "./1/*" -exec cp --parent -t ${newdir}/ {} + | |
| 17 | + | done | |
| 18 | + | ||
| 19 | + | cd ${WD} && tar -czf ${now}.tar.gz -C ${WD} . | |
| 20 | + | ||
| 21 | + | /bin/rm -rf ./${now} | |
| 22 | + | ||
| 23 | + | # extract: | |
| 24 | + | # tar xzf *.tar.gz --transform='s/.*\///' && find . -type d -empty -delete |