Q:

Archive a document library after 30 days?

I am very new to this concept of archiving and record management.
I have the following requirements:

Create a document library when a new event is added. I can do this with an event receiver.
The document library should be archived for 30 days.

The 2nd item I have no idea how to do it using code.  Where is it archived?

A:

The quickest way to archive would be to export the document library using the Export-SPWeb PowerShell command. Use Import-SPWeb for restoration (archives are file packages that can use optional compression. See the -Path and other options in the Export-SPWeb command).
Other PowerShell posts to manage the document library (cleanups, uploads, etc) -

Using PowerShell to clean up SharePoint document library files 
Use PowerShell Cmdlets to Manage SharePoint Document Libraries 
Phil Childs' Get-SPScripts on Document Management

If you must - there are commercial companies like AvePoint, Metalogix, Idera & Axceler that provide utilities for library archving & backup administration.

