Brackup

 view release on metacpan or  search on metacpan

brackup-restore  view on Meta::CPAN

#!/usr/bin/perl

# TODO: skip-if-exists (and ignore zero byte files)
# TODO: continue-on-errors
# Error doing restore: File restore/.brackup-digest.db (.brackup-digest.db) already exists.  Aborting. at /raid/bradfitz/proj/brackup/trunk/lib/Brackup/Restore.pm line 157, <$fh> line 20.

=head1 NAME

brackup-restore - The brackup restore tool.

=head1 SYNOPSIS

 $ brackup-restore [-v] --from=foo.brackup --to=<base_directory> --all
 $ brackup-restore [-v] --from=foo.brackup --to=<base_directory> --just=<file>
 $ brackup-restore [-v] --from=foo.brackup --to=<base_directory> --just=<dir>

=head2 OPTIONS

=over 4

=item --from=NAME

Required.  The backup metafile, describing the tree you want to restore.  
Probably named like "source-target-YYYYMMDD.brackup".  If you lost it, 
it's also stored on your backup target, and you can fetch it with
L<brackup-target>.

=item --to=NAME

Required.  The destination root directory for your restored files.
Will be created if it doesn't exist.

=item --all

Restore all files.

=item --just="DIRECTORY"

Restore just the directory named (and all its contents). 

=item --just="FILE"

Restore just the file named.

=item --config=NAME

Brackup config file to use instead of default.

=item --verbose|-v

Show more info during restore.

=back

=head1 WARRANTY

Brackup is distributed as-is and comes without warranty of any kind,
expressed or implied.  We aren't responsible for your data loss.

=head1 AUTHOR

Brad Fitzpatrick E<lt>brad@danga.comE<gt>

Copyright (c) 2006-2007 Six Apart, Ltd. All rights reserved.

This module is free software. You may use, modify, and/or redistribute this
software under the terms of same terms as perl itself.

=cut

use strict;
use warnings;
use Getopt::Long;
use File::Path;

use FindBin qw($Bin);
use lib "$Bin/lib";

use Brackup;
use Brackup::Util qw(tempfile);

my ($opt_verbose, $meta_file, $opt_help, $restore_dir, $opt_all, $prefix, $config_file);

usage() unless
    GetOptions(



( run in 0.717 second using v1.01-cache-2.11-cpan-5a3173703d6 )