Changeset 331
- Timestamp:
- 07/28/06 13:03:44 (2 years ago)
- Location:
- mysqldump2email/trunk
- Files:
-
- 2 modified
-
config.yaml.sample (modified) (1 diff)
-
mysqldump2email (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mysqldump2email/trunk/config.yaml.sample
r324 r331 19 19 # via: sendmail 20 20 21 gspace: 22 enable: 0 23 directory: / 24 21 25 tmpdir: /tmp 22 26 #time_zone: Asia/Tokyo -
mysqldump2email/trunk/mysqldump2email
r327 r331 11 11 use DateTime; 12 12 use File::Spec; 13 use File::Basename; 13 14 use Pod::Usage; 14 15 use Getopt::Long; 15 16 16 our $VERSION = '0.0 1';17 our $VERSION = '0.02'; 17 18 18 19 my %opt = (conf => 'config.yaml'); … … 26 27 27 28 my $zipfile = dump_mysql($cfg, $dt); 29 my $attachfile = basename($zipfile); 28 30 my $cfg_mail = $cfg->{mail} 29 31 or die 'No "mail" setting found in config.yaml'; … … 32 34 MIME::Lite->send($mailroute->{via}, 33 35 $mailroute->{host} ? ($mailroute->{host}) : ()); 36 37 my $subject = __PACKAGE__; 38 if ($cfg->{gspace} && $cfg->{gspace}->{enable}) { 39 $subject = join('|', ( 40 'GSPACE', 41 $attachfile, 42 $dt->epoch % 10000, # pseudo-random id ;) 43 1, 44 1, 45 int((-s $zipfile) / 1024), 46 'gs:' . ($cfg->{gspace}->{directory} || '/') . ' d$' 47 )); 48 } 34 49 35 50 my $rfc822date = $dt->strftime('%a, %d %b %Y %H:%M:%S %z'); … … 38 53 From => __PACKAGE__ . ' <' . $cfg_mail->{from} . '>', 39 54 To => $cfg_mail->{to}, 40 Subject => encode('MIME-Header', __PACKAGE__),55 Subject => encode('MIME-Header', $subject), 41 56 Type => 'multipart/mixed', 42 57 ); … … 48 63 Type => 'application/zip', 49 64 Path => $zipfile, 50 Filename => __PACKAGE__ . '.zip',65 Filename => $attachfile, 51 66 Disposition => 'attachment', 52 67 ); … … 189 204 =back 190 205 206 =item gspace: 207 208 =over 4 209 210 =item enable 211 212 Set 1 to enable gspace (http://www.rjonna.com/ext/gspace.php) support. 213 214 =item directory 215 216 Set the gspace directory, where attached files will be stored in. 217 218 =back 219 191 220 =item tmpdir: 192 221
![(please configure the [header_logo] section in trac.ini)](/public/chrome/common/trac_banner.png)