Show
Ignore:
Timestamp:
06/25/08 13:52:20 (7 months ago)
Author:
ogawa
Message:

Add version number and remove bogus messages.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mt4-backup/trunk/backup

    r462 r463  
    1010use base qw( MT::Tool ); 
    1111 
     12our $VERSION = '0.1'; 
     13 
    1214sub usage { '[--dir <dir>] [--blog_ids <id1,id2,...>] [--size <num>] [--archive=zip|tgz]' } 
    1315 
    1416sub help { 
    15     return q{ 
    16         Creates a backup image. 
     17    return qq{ 
     18        backup $VERSION - A command-line tools for backup 
    1719 
    1820        --dir <dir> 
     
    3032                just generates a set of backup files and does not create  
    3133                a compressed archive file. 
     34 
    3235    }; 
    3336} 
     
    113116            close $fh; 
    114117            if ($archive) { 
     118                my $filepath = File::Spec->catfile( $temp_dir, "$file.$archive" ); 
    115119                require MT::Util::Archive; 
    116                 my $filepath = File::Spec->catfile( $temp_dir, "$file.$archive" ); 
    117120                my $arc = MT::Util::Archive->new($archive, $filepath); 
    118121                $arc->add_file( $temp_dir, "$file.xml" ); 
     
    123126                      "$file.manifest"); 
    124127                $arc->close; 
     128                # for safery, don't unlink before closing $arc here. 
    125129                unlink $filename; 
    126130            } 
     
    180184                  . "' />\n"; 
    181185                push @files, $name; 
    182                 print STDERR "Asset file '$name' (ID=$id) is created\n" if $verbose; 
    183186            } 
    184187            print $fh "</manifest>\n"; 
    185188            close $fh; 
    186189            push @files, "$file.manifest"; 
    187             print STDERR "Manifest file '$file.manfest' is created\n" if $verbose; 
    188190 
    189191            if ($archive) { 
     
    195197                } 
    196198                $arc->close; 
    197                 print STDERR "Archive file '$file.$archive' is created\n" if $verbose; 
    198199                # for safery, don't unlink before closing $arc here. 
    199200                for my $f (@files) { 
    200201                    unlink File::Spec->catfile( $temp_dir, $f ); 
    201                     print STDERR "File '$f' is removed\n" if $verbose; 
    202202                } 
    203203            }