| Mozilla-Backup documentation | view source | Contained in the Mozilla-Backup distribution. |
Mozilla::Backup::Plugin::FileCopy - A file copy plugin for Mozilla::Backup
use Mozilla::Backup;
my $moz = Mozilla::Backup->new(
plugin => 'Mozilla::Backup::Plugin::FileCopy'
);
This is a plugin for Mozilla::Backup which copies profiles to another directory.
$plugin = Mozilla::Backup::Plugin::FileCopy->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.
@options = Mozilla::Backup::Plugin::FileCopy->allowed_options();
if (Mozilla::Backup::Plugin::FileCopy->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.
$directory = $plugin->munge_location( $directory );
Munges the backup location name for use by this plugin. (Currently has no effect.)
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.
If you would like to create backups in a format for which no plugin is available, you can use Mozilla::Backup::Plugin::FileCopy with a system call to the appropriate archiver. For example,
$moz = Mozilla::backup->new(
plugin => "Mozilla::Backup::Plugin::FileCopy",
);
$dest = $moz->backup_profile(
type => "firefox",
name => "default",
);
system("tar cf - $dest |bzip2 - > firefox-default-profile.tar.bz2");
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. |