Last active
December 16, 2020 23:59
-
-
Save nikto-b/b84e03ce625989a56d814b5005a46973 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get all files in $DIR that matches $NAME created last $MINUTE minutes, sort them in alphabet, | |
#copy in current dir as jpg(sorry) and try to compress in $SIZE size (for example 400K) | |
export count=1 | |
export files="$(find $DIR -type d -name $NAME -prune -o -mmin -MINUTE -type f -print | rg -v '\(' | sort -t _ -k 2 -g | tr '\n' ' ')" | |
for i in $(echo $files); do | |
cp $i ./$count.jpg | |
jpegoptim --size=$SIZE $count.jpg | |
count=$(($count+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment