Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lukapaunovic/79e3cd701a688cd2cf645a21e7696e4d to your computer and use it in GitHub Desktop.
Save lukapaunovic/79e3cd701a688cd2cf645a21e7696e4d to your computer and use it in GitHub Desktop.
yum install epel-release -y
yum install jpegoptim -y
yum install optipng -y
for i in `ls --hide='system' /var/cpanel/users/`; do
find /home/$i/ -type f -iname '*.jpg' -print0 | xargs -0 -n4 -P5 sudo -H -u $i jpegoptim -s
find /home/$i/ -type f -iname '*.jpeg' -print0 | xargs -0 -n4 -P5 sudo -H -u $i jpegoptim -s
find /home/$i/ -type f -iname '*.png' -print0 | xargs -0 -n4 -P5 sudo -H -u $i optipng -o1 -strip all
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment