Archiving
*********


Description
===========

When we talk about "Archiving" in Cyrus (from 3.0 onwards) we're not
talking about data retention, what we're really talking about is time-
tiered storage.  Elsewhere in these documents we discuss storage
tiering based on things like space limitations or scalability.
Archiving is somewhat like this, but with an accompanying
configuration syntax which determines the management of the tiered
data on an ongoing basis.


Purpose
=======

The general intent of archiving, as deployed within Cyrus, is to allow
administrators to dictate that there be two tiers of data storage for
each mail spool partition: "current" and "archive."  The common use
case is to use higher speed storage media for the former, and lower
cost media for the latter; Current goes on SSDs, and Archive goes on
traditional spinning media.


Enabling
========

Archive operation in Cyrus is enabled via the "archive_enabled"
setting in imapd.conf(5).


Defining
========

The configuration suite provides directives to define these
partitions:

   * "archivepartition-name"


Controlling
===========

And to control the criteria used to manage migration of data between
partitions:

   * "archive_after"

   * "archive_maxsize"

   * "archive_keepflagged"

Note:

  Further explanation is probably required for the "archive_maxsize"
  option.  The value is a threshold.  Messages larger than this
  threshold will be immediately put onto the archive partition, rather
  than waiting for "archive_after" to pass. This is to keep the high
  speed storage available for the largest number of "current"
  messages.So "archive_maxsize" is not the maximum size of messages
  which will be archived, but rather is the threshold above which they
  will immediately be.


Performing
==========

Finally, the actual migration is handled by invoking cyr_expire(8)
with its "-A" flag, as shown here in a sample snippet from
cyrus.conf(5) (but could also be done via "cron"):

   EVENTS {
       ...
       archive      cmd="cyr_expire -A 7d" at=0403
       ...
   }
