Chroniton

NAME

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

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

This is a development version because it's not yet feature complete. Mainly, archiving and an exclude list are not yet implemented. It's also not as fast as possible, and the logging could be more efficient. However, the API is pretty stable, and everything that is implemented works according to the documentation. I feel safe backing up my workstation with it.

It's also pretty well tested: (88% is a B+ :).)

------------------ ------ ------ ------ ------ ------ ------ ------
File                 stmt   bran   cond    sub    pod   time  total
------------------ ------ ------ ------ ------ ------ ------ ------
Chroniton.pm         90.2   46.4   68.8  100.0  100.0    9.3   84.8
Backup.pm            91.3   70.4   58.3  100.0  100.0   31.9   84.8
Config.pm            94.7   60.0   66.7  100.0  100.0    4.2   87.8
Event.pm            100.0    n/a    n/a  100.0  100.0    1.9  100.0
FileInSet.pm        100.0  100.0    n/a  100.0  100.0    7.3  100.0
Message.pm          100.0  100.0  100.0  100.0  100.0   16.1  100.0
Messages.pm          89.2   83.3   66.7  100.0  100.0   18.0   88.5
Restore.pm           91.9   68.0   67.9  100.0  100.0    7.7   83.9
State.pm            100.0  100.0  100.0  100.0  100.0    3.7  100.0
Total                92.9   70.9   71.1  100.0  100.0  100.0   88.5
------------------ ------ ------ ------ ------ ------ ------ ------

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 in the production version -- 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::Messags 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 config 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(path, [from])

Restores path to its original location on the filesystem. If the file already exisits, this method will die. If you want to restore a file that exists, do it with cp.

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.

If you're still confused, mail the author (but don't expect a reply if the question is answered in This Fine Manual.)

CONTRIBUTING

Please send me bug reports (via RT), test cases, comments on whether or not you like the software, and patches! I always have time to reply to intelligent commentary.

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.