this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 44 lines 971 B view raw
1#!/usr/bin/env bash 2 3basedir="/mnt/tank/tinypin-data/images" 4WD="/home/kat/tinypin-log" 5nowdate=$(date "+%Y-%m-%d") 6newdir="$WD/$nowdate" 7 8default() { 9 cd "$WD" && mkdir -p "$newdir" 10 11 echo "copying pics" 12 13 for f in *.jpg *.JPG *.jpeg *.png *.webp *.gif; do 14 cd "$basedir" && find . -type f -not -path "./1/*" -exec cp --parent -t "$newdir"/ {} + 15 done 16 17 echo "zipping pics" 18 19 cd "$WD" && tar -czf "$nowdate".tar.gz -C "$WD" ./"$nowdate" 20 21 /bin/rm -rf "$nowdate" 22 23} 24 25extpics() { 26 mkdir "$nowdate"_ext 27 tar xzf "$nowdate".tar.gz --transform='s/.*\///' -C "$nowdate"_ext && find ./"$nowdate"_ext -type d -empty -delete 28 /bin/rm -rf "nowdate".tar.gz 29} 30 31syncpics() { 32 echo "syncing pics" 33 rsync -avz --progress "$nowdate"_ext athena:/home/kat/backups/tile || echo "sync failed" && exit 1 34 /bin/rm -rf "$nowdate"_ext 35} 36 37case "$1" in 38 "") default;; 39 "-e") extpics;; 40 "-s") syncpics;; 41esac 42 43# extract: 44# tar xzf *.tar.gz --transform='s/.*\///' && find . -type d -empty -delete