dots


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