Created
August 19, 2019 08:32
-
-
Save konratnox/302d5afad5833f6526984cefacfb7a50 to your computer and use it in GitHub Desktop.
This file contains 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
BOPTI=`du -L -s ${SITEDIR} | awk '{print $1}'` | |
find -L ${SITEDIR} -type f -iname '*.jpg' \ | |
-exec jpegoptim -q --strip-all {} \; \ | |
-exec chown ${SITEUSER}:www-data {} \; \ | |
-exec chmod 664 {} \; | |
find -L ${SITEDIR} -type f -iname '*.png' \ | |
-exec optipng -quiet -clobber -fix -strip all {} \; \ | |
-exec chown ${SITEUSER}:www-data {} \; \ | |
-exec chmod 664 {} \; | |
#find -LE ${SITEDIR} -type f -iregex '.*\.(jpg|png)$' \ | |
#-exec jpegoptim -q --strip-all {} \; \ | |
#-exec optipng -quiet -clobber -fix -o7 -strip all {} \; \ | |
#-exec chown ${SITEUSER}:www-data {} \; \ | |
#-exec chmod 775 {} \; | |
AOPTI=`du -L -s ${SITEDIR} | awk '{print $1}'` | |
echo -n "Saved " | |
echo -n "$((BOPTI-AOPTI))" | |
echo " Kb" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment