Last active
November 9, 2019 13:10
-
-
Save dalibor-sojic/9861933ae29b27e6586857abeab4f473 to your computer and use it in GitHub Desktop.
Optimize images on upload with inotify and jpgoptim
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
#!/usr/bin/env | |
MONITORDIR="/home/_______/public_html/wp-content/uploads/" | |
inotifywait -m -r -e create --format '%w%f' "${MONITORDIR}" | while read NEWFILE | |
do | |
jpegoptim --strip-all ${NEWFILE} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment