| Mozilla-Backup documentation | view source | Contained in the Mozilla-Backup distribution. |
Mozilla::Backup::Plugin::Tar - A tar archive plugin for Mozilla::Backup
use Mozilla::Backup;
my $moz = Mozilla::Backup->new(
plugin => 'Mozilla::Backup::Plugin::Tar'
);
This is a plugin for Mozilla::Backup which allows backups to be saved as tar files.
$plugin = Mozilla::Backup::Plugin::Tar->new( %options );
The following %options are supported:
The Log::Dispatch objetc used by Mozilla::Backup. This is required.
The debug flag from Mozilla::Backup. This is not used at the moment.
Compress the archive when saving. Enabled by default.
@options = Mozilla::Backup::Plugin::Tar->allowed_options();
if (Mozilla::Backup::Plugin::Tar->allowed_options('debug')) {
...
}
If no arguments are given, it returns a list of configuration parameters that can be passed to the constructor. If arguments are given, it returns true if all of the arguments are allowable options for the constructor.
$filename = $plugin->munge_location( $filename );
Munges the archive name by adding the "tar" or "tar..gz" extension to it, if it does not already have it. If called with no arguments, just returns ".tar" or ".tar.gz" (depending on whether the compress option is given).
if ($plugin->open_for_backup( $filename, %options )) {
...
}
Creates a new archive for backing the profile. $filename is the
name of the archive file to be used. %options are optional
configuration parameters.
if ($plugin->open_for_restore( $filename, %options )) {
...
}
Opens an existing archive for restoring the profile.
@files = $plugin->get_contents;
Returns a list of files in the archive.
$plugin->backup_file( $local_file, $internal_name );
Backs up the file in the archive, using $internal_name as the
name in the archive.
$plugin->restore_file( $internal_name, $local_file );
Restores the file from the archive.
$plugin->close_backup();
Closes the backup.
$plugin->close_restore();
Closes the restore.
Robert Rothenberg <rrwo at cpan.org>
Copyright (c) 2005 Robert Rothenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Mozilla-Backup documentation | view source | Contained in the Mozilla-Backup distribution. |