Skip to content

Instantly share code, notes, and snippets.

@lt
Created November 2, 2012 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lt/4002185 to your computer and use it in GitHub Desktop.
Save lt/4002185 to your computer and use it in GitHub Desktop.
gzip new or modified files in the "static" directory.
#!/bin/sh
for file in $(find static -type f ! -name *.gz); do
if [ ! -e $file.gz ] || [ $file -nt $file.gz ]; then
gzip -9 -n -c -v $file > $file.gz
touch $file.gz -r $file
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment