Created
July 17, 2018 08:23
-
-
Save barryvdh/ba1cd9f1f16fdc0b41eefffb874eca77 to your computer and use it in GitHub Desktop.
Optimize images in last 24 hours
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
#!/bin/bash | |
find ./media -mmin -1440 -type f -iname '*.gif' -exec sh -c 'gifsicle -b -O3 "{}"' \; | |
find ./media -mmin -1440 -type f -iname '*.png' -exec optipng -o7 -strip all -preserve '{}' \; | |
find ./media -mmin -1440 -type f -iname '*.jpg' -exec jpegoptim --strip-all -m85 -o -p {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment