Chroniton

NAME

Chroniton.pm - simple backup system with archiving and incremental backups

ABSTRACT

This module is the interface to the exciting functionality provided by the other Chroniton:: modules. The interface is action oriented, suitable for use by backup client software or even other scripts or modules. If you're an end user, see chroniton.pl.

SYNOPSIS

my $chroniton = Chroniton->new;
$chroniton->backup;     
print $chroniton->summary;
exit 0;

TODO and NOTES

Note that the test suite plays around with your filesystem a bit. It adds a config file (that you'll want later anyway), and touches /tmp. I'll fix this Real Soon -- some other Test::* modules need to be written first.

As always, bug reports, feature request, rants about why this package is unnecessary, etc., are welcomed. I'd especially like to hear from Windows users, since I don't have a Windows machine anywhere, nor do I understand the semantics of the Windows filesystem.

I'd also like to know if the individual component modules would be useful to anyone if they were available separately. Logging has been done to death, but I think there are some useful features in my Chroniton::Messages module. Let me know what you think.

CONSTRUCTOR

new (\%args)

Creates a new Chroniton, which encapsulates time itself! All arguments are optional, and include:

log

The Chroniton::Messages object to store log entries to.

config

The Chroniton::Config object to glean configuration information from.

interactive

Set to true if it's OK to print informative messages to STDOUT and STDERR.

verbose

Set to true if you'd like those messages to be verbose.

What's a chroniton, anyway? http://www.gotfuturama.com/Information/Capsules/3ACV14.txt.

METHODS

backup

Performs a backup in accordance with the config file -- full if a full backup is required, incremental otherwise. If the configuration dictates that an archive should performed, it will be.

force_incremental([against])

Forces an incremental backup against against. If against isn't specified, the incremental backup will be performed against the last backup. If that doesn't exist, the method will die.

force_backup

Forces a full backup in accordance with the configuration file.

force_archive

Archives all backup data in the backup storage directory.

restorable(filename)

Returns a list of all restorable versions of filename. The list is a list of array references, which is formatted according to "FUNCTIONS/restorable" in Chroniton::Restore.

restore(file, [force])

Restores file (a Chroniton::File object as returned by restorable) to its original location, overwriting it if force is true.

summary

Returns a summary of the actions performed, suitable for presenting to the user when a backup or restore is complete.

DIAGNOSTICS

Error creating Chroniton: $@

Something bad happened while initilizing the object. Possibilities include problems loading the configuration, problems creating the logging object (unlikely), problems restoring the state, or a storm of cosmic rays hiting your non-ECC RAM. Make sure your config is sane and try again. (More information is printed as $@.)

Not yet implemented

You're using functionality that doesn't exist. You shouldn't see this unless the version number contains a _, in which case it's a developer's release.

MORE DOCUMENTATION

See chroniton.pl if you're an end user, or Chroniton::Backup, Chroniton::Restore, or Chroniton::Archive if you're a developer. Chroniton::State, Chroniton::Config, Chroniton::BackupContents, Chroniton::Messages, Chroniton::Message, and Chroniton::Event are also available for your perusal.

CONTRIBUTING

Please send me bug reports (via the CPAN RT), test cases, comments on whether or not you like the software :), and patches.

AUTHOR

Jonathan Rockway <jrockway at cpan.org>.

COPYRIGHT

Chroniton is Copyright (c) 2006 Jonathan Rockway.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.