tylerhall's Autosmush at master - GitHub

Autosmush is a command line tool which scans an Amazon S3 bucket and losslessly compresses your images using Yahoo!'s amazing Smush.it web service. It also adds a far-future expires header on your images to aid in browser caching as recommended by YSlow. Autosmush can be run manually or as a cron job. It avoids re-smushing images by checking for an 'x-amz-smushed' HTTP header on already processed images.

via github.com