I've been doing my routine backups (read this as snapshots) of my Maildir folder in work recently. Doing a du -s Maildir

[jtang@marduk ~]$ du -s Maildir
3840080 Maildir

Which is approximately 3.7gb of text files. I naively did what I usually do to snapshot/archive my mails by just tar'ing up and bzip2'ing the the directory.

[jtang@marduk ~]$ tar -cf - Maildir | bzip2 > Maildir-$(date -I).tar.bz2

The above resulted in a compressed tarball that was about 690mbytes. So I looked around to see what else was good for compressing data. There's p7zip, paq, dar and lzma. lzma seemed to be the most popular for now. So I gave that a try

[jtang@marduk ~]$ tar -cf - Maildir | lzma -c > Maildir-$(date -I).tar.lzma

Here's the results of compressed tarballs

[jtang@marduk ~]$ ls -l Maildir-*
-rw-r--r-- 1 jtang users 3034542080 May 23 22:37 Maildir-2009-05-24.tar
-rw-r--r-- 1 jtang users  722575723 May 23 22:37 Maildir-2009-05-24.tar.bz2
-rw-r--r-- 1 jtang users  586280476 May 24 00:11 Maildir-2009-05-24.tar.lzma

lzma was easily better in this case than bzip2 for compressing my Maildir directory of files. But lzma is certainly less convenient than bzip2 when it comes to moving my files around to machines that might not have lzma. dar was the other interesting backup program, I'd probably use it more if it was tar like :) and everywhere! I've used dar a few times already to backup entire machines. It's nice being able to extract individual files from an archive without the need to process the entire archive.

Bookmark and Share