Changeset 463 for mt4-backup/trunk/backup
- Timestamp:
- 06/25/08 13:52:20 (7 months ago)
- Files:
-
- 1 modified
-
mt4-backup/trunk/backup (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mt4-backup/trunk/backup
r462 r463 10 10 use base qw( MT::Tool ); 11 11 12 our $VERSION = '0.1'; 13 12 14 sub usage { '[--dir <dir>] [--blog_ids <id1,id2,...>] [--size <num>] [--archive=zip|tgz]' } 13 15 14 16 sub help { 15 return q {16 Creates a backup image.17 return qq{ 18 backup $VERSION - A command-line tools for backup 17 19 18 20 --dir <dir> … … 30 32 just generates a set of backup files and does not create 31 33 a compressed archive file. 34 32 35 }; 33 36 } … … 113 116 close $fh; 114 117 if ($archive) { 118 my $filepath = File::Spec->catfile( $temp_dir, "$file.$archive" ); 115 119 require MT::Util::Archive; 116 my $filepath = File::Spec->catfile( $temp_dir, "$file.$archive" );117 120 my $arc = MT::Util::Archive->new($archive, $filepath); 118 121 $arc->add_file( $temp_dir, "$file.xml" ); … … 123 126 "$file.manifest"); 124 127 $arc->close; 128 # for safery, don't unlink before closing $arc here. 125 129 unlink $filename; 126 130 } … … 180 184 . "' />\n"; 181 185 push @files, $name; 182 print STDERR "Asset file '$name' (ID=$id) is created\n" if $verbose;183 186 } 184 187 print $fh "</manifest>\n"; 185 188 close $fh; 186 189 push @files, "$file.manifest"; 187 print STDERR "Manifest file '$file.manfest' is created\n" if $verbose;188 190 189 191 if ($archive) { … … 195 197 } 196 198 $arc->close; 197 print STDERR "Archive file '$file.$archive' is created\n" if $verbose;198 199 # for safery, don't unlink before closing $arc here. 199 200 for my $f (@files) { 200 201 unlink File::Spec->catfile( $temp_dir, $f ); 201 print STDERR "File '$f' is removed\n" if $verbose;202 202 } 203 203 }
![(please configure the [header_logo] section in trac.ini)](/public/chrome/common/trac_banner.png)