Changeset 161 for trunk/brackup-target

Show
Ignore:
Timestamp:
08/02/07 20:54:41 (2 years ago)
Author:
bradfitz
Message:

'prune' and 'gc' commands commands for both Amazon
and Filesystem targets. from Alessandro Ranellucci <aar@…>.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/brackup-target

    r158 r161  
    1111 $ brackup-target [opts] <target_name> get_backups 
    1212 $ brackup-target [opts] <target_name> delete_backup <backup_file> 
    13  $ brackup-target [opts] <target_name> gc   # run garbage collector 
     13 $ brackup-target [opts] <target_name> prune   # remove old backups 
     14 $ brackup-target [opts] <target_name> gc      # run garbage collector 
    1415 
    1516=head2 OPTIONS 
     
    2425 
    2526Be verbose with status. 
     27 
     28=item --dry-run 
     29 
     30Do not actually execute write operations. 
     31 
     32=item --keep-backups 
     33 
     34To be used in combination with the I<prune> command. This overrides the  
     35I<keep_backups> option specified in the configuration file. 
    2636 
    2737=back 
     
    6171my $opt_help; 
    6272my $opt_verbose; 
     73my $opt_keep_backups; 
     74my $opt_dryrun; 
    6375usage() unless 
    6476    GetOptions( 
     
    6678               'dest=s'   => \$destdir, 
    6779               'config=s' => \$config_file, 
     80               'keep-backups=i' => \$opt_keep_backups, 
     81               'dry-run'   => \$opt_dryrun, 
    6882               'help'     => \$opt_help, 
    6983               ); 
     
    132146} 
    133147 
     148sub CMD_prune { 
     149    my $removed_count = $target->prune( keep_backups => $opt_keep_backups, 
     150                                        dryrun => $opt_dryrun); 
     151    debug("$removed_count backups removed from target"); 
     152} 
     153 
     154sub CMD_gc { 
     155    my $removed_chunks = $target->gc(dryrun => $opt_dryrun); 
     156    debug("$removed_chunks chunks removed from target"); 
     157} 
     158 
    134159sub debug { 
    135160    my $msg = shift;