Package CedarBackup2 :: Package extend :: Module mbox
[show private | hide private]
[frames | no frames]

Module CedarBackup2.extend.mbox

Provides an extension to back up mbox email files.

Backing up email

Email folders (often stored as mbox flatfiles) are not well-suited being backed up with an incremental backup like the one offered by Cedar Backup. This is because mbox files often change on a daily basis, forcing the incremental backup process to back them up every day in order to avoid losing data. This can result in quite a bit of wasted space when backing up large folders. (Note that the alternative maildir format does not share this problem, since it typically uses one file per message.)

One solution to this problem is to design a smarter incremental backup process, which backs up baseline content on the first day of the week, and then backs up only new messages added to that folder on every other day of the week. This way, the backup for any single day is only as large as the messages placed into the folder on that day. The backup isn't as "perfect" as the incremental backup process, because it doesn't preserve information about messages deleted from the backed-up folder. However, it should be much more space-efficient, and in a recovery situation, it seems better to restore too much data rather than too little.

What is this extension?

This is a Cedar Backup extension used to back up mbox email files via the Cedar Backup command line. Individual mbox files or directories containing mbox files can be backed up using the same collect modes allowed for filesystems in the standard Cedar Backup collect action: weekly, daily, incremental. It implements the "smart" incremental backup process discussed above, using functionality provided by the grepmail utility.

This extension requires a new configuration section <mbox> and is intended to be run either immediately before or immediately after the standard collect action. Aside from its own configuration, it requires the options and collect configuration sections in the standard Cedar Backup configuration file.

The mbox action is conceptually similar to the standard collect action, except that mbox directories are not collected recursively. This implies some configuration changes (i.e. there's no need for global exclusions or an ignore file). If you back up a directory, all of the mbox files in that directory are backed up into a single tar file using the indicated compression method.

Author: Kenneth J. Pronovici <pronovic@ieee.org>

Classes
LocalConfig Class representing this extension's configuration document.
MboxConfig Class representing mbox configuration.
MboxDir Class representing mbox directory configuration..
MboxFile Class representing mbox file configuration..

Function Summary
  executeAction(configPath, options, config)
Executes the mbox backup action.

Variable Summary
list GREPMAIL_COMMAND = ['grepmail']
Logger logger = <logging.Logger instance at 0x403fc86c>
str REVISION_PATH_EXTENSION = 'mboxlast'

Function Details

executeAction(configPath, options, config)

Executes the mbox backup action.
Parameters:
configPath - Path to configuration file on disk.
           (type=String representing a path on disk.)
options - Program command-line options.
           (type=Options object.)
config - Program configuration.
           (type=Config object.)
Raises:
ValueError - Under many generic error conditions
IOError - If a backup could not be written for some reason.

Variable Details

GREPMAIL_COMMAND

Type:
list
Value:
['grepmail']                                                           

logger

Type:
Logger
Value:
<logging.Logger instance at 0x403fc86c>                                

REVISION_PATH_EXTENSION

Type:
str
Value:
'mboxlast'                                                             

Generated by Epydoc 2.1 on Thu Mar 29 20:58:29 2007 http://epydoc.sf.net