When you use ‘find’ and ‘zip’ in one sentence…

Instead of

find albums -name *.jpg -not -name *.sized.jpg -not -name *.thumb.jpg -not -name *.highlight.jpg -exec zip -r -1 album.zip {} ;&

use

find albums -name *.jpg -not -name *.sized.jpg -not -name *.thumb.jpg -not -name *.highlight.jpg -print| zip -1 album.zip -@

It will take 5 minutes instead of 5 hours on 500MB archive.

This entry was posted in unix and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>