Robert Rothenberg > Mozilla-Backup > Mozilla::Backup::Plugin::Tar

Download:
Mozilla-Backup-0.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  4
Open  1
View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Mozilla::Backup::Plugin::Tar - A tar archive plugin for Mozilla::Backup

SYNOPSIS ^

  use Mozilla::Backup;

  my $moz = Mozilla::Backup->new(
    plugin => 'Mozilla::Backup::Plugin::Tar'
  );

DESCRIPTION ^

This is a plugin for Mozilla::Backup which allows backups to be saved as tar files.

new
  $plugin = Mozilla::Backup::Plugin::Tar->new( %options );

The following %options are supported:

log

The Log::Dispatch objetc used by Mozilla::Backup. This is required.

debug

The debug flag from Mozilla::Backup. This is not used at the moment.

compress

Compress the archive when saving. Enabled by default.

allowed_options
  @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.

munge_location
  $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).

open_for_backup
  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.

open_for_restore
  if ($plugin->open_for_restore( $filename, %options )) {
    ...
  }

Opens an existing archive for restoring the profile.

get_contents
  @files = $plugin->get_contents;

Returns a list of files in the archive.

backup_file
  $plugin->backup_file( $local_file, $internal_name );

Backs up the file in the archive, using $internal_name as the name in the archive.

restore_file
  $plugin->restore_file( $internal_name, $local_file );

Restores the file from the archive.

close_backup
  $plugin->close_backup();

Closes the backup.

close_restore
  $plugin->close_restore();

Closes the restore.

AUTHOR ^

Robert Rothenberg <rrwo at cpan.org>

LICENSE ^

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.

syntax highlighting: