sub makebackup : Local {
my ( $self, $c ) = @_;
$_ = $c->config->{'Model::SecureSBMDB'}->{connect_info}[0];
my ( $dbi, $dbd, $dbparams ) = split( ':' );
my ( @dbparams ) = split( ';', $dbparams );
my %dbparams;
foreach my $d (@dbparams){
my ( $name, $data ) = split( '=', $d );
$dbparams{$name} = $data;
}
my $dbname = (defined $dbparams{dbname})?$dbparams{dbname}:'';
my $dbuser = $c->config->{'Model::SecureSBMDB'}->{connect_info}[1];
my $dbpwd = $c->config->{'Model::SecureSBMDB'}->{connect_info}[2]; if( $dbd eq 'Pg' ){
my $dbhostopt = (defined $dbparams{host})?
"-h $dbparams{host}":'';
my $dbportopt = (defined $dbparams{port})?
"-p $dbparams{port}":'';
my $dbfileopt = "-f $backuppath";
system( "pg_dump -U $dbuser -F t $dbhostopt $dbportopt
$dbfileopt $dbname" );
my ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
$atime, $mtime, $ctime, $blksize, $blocks )
= stat($backuppath);
my ( $sec, $min, $hour, $mday, $mon,
$year, $wday, $yday, $isdst )
= localtime($mtime);
my $filestat
= sprintf( '%s <br />owner:%s group:%s size:%s
<br />mtime: %4d/%02d/%02d %02d:%02d:%02d',
$backupfilename, $uid, $gid, $size,
$year + 1900, $mon + 1, $mday, $hour, $min, $sec
);
$c->stash->{backupfileinfo} = $filestat;
$c->stash->{backupfilename} = $backupfilename;
}else{
# Not implimented
$c->stash->{resultmessage} = 'Not implimented yet';
}
$c->forward('index');
} # end of makebackup()sub getbackup : Local {
my ( $self, $c, $bfname ) = @_;
if( $bfname ne $backupfilename ){
$c->forward('index');
return 0;
}
my $backupfilepath = $backupdir . '/' . $bfname;
my ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
$atime, $mtime, $ctime, $blksize, $blocks ) = stat($backupfilepath);
my $bfcontents = '';
if( open( BFH, $backupfilepath ) ){
my $rsize = 1;
while( $rsize && $size > 0){
my $tmp;
$rsize = read( BFH, $tmp, $size );
$bfcontents .= $tmp;
$size -= $rsize;
}
close( BFH );
}
$c->res->headers->header(
'Content-Type' => 'application/x-tar;'
. 'name="' . $bfname . '";' );
$c->res->body( $bfcontents );
$c->forward('index');
} # end of getbackup()
Keyword: Perl Catalyst Secure-SBM SSBM セキュア・ソーシャル・ブックマーク オープンソース
タグ:Secure-SBM
<< [Secure-SBM:026] サービスの閉塞処理 | Main | 0.3.0 リリース: Secure-SBM (セキュア・ソーシャル・ブックマーク) >>
いかちょー (2007-07-26 12:54) | コメント(0)| トラックバック(29)
トラックバックURL:
Ephedrine from sugar recipe. - Ephedrine. (2010年1月30日 17:06)
Ephedrine. Ephedrine faq. 続きを読む
Fioricet online. - Fioricet tablet. (2010年2月12日 02:56)
Fioricet. Cheapest fioricet. Buy fioricet online without a prescription. 続きを読む
Fioricet. - Generic fioricet. (2010年2月12日 10:57)
Fioricet. Buy fioricet. Order fioricet online. Cheap fioricet. Fioricet online. 続きを読む
Fioricet. - Fioricet side effects. (2010年2月12日 19:55)
How long does fioricet show up in blood work. Fioricet c.o.d.. 続きを読む
Fioricet. - Fioricet. (2010年2月17日 00:03)
Fioricet. Buy fioricet overnight. Cheap fioricet w free shipping. Buy fiorice... 続きを読む
Fioricet. - Fioricet. (2010年2月17日 03:24)
Fioricet. Buy fioricet online. Buy fioricet. Generic fioricet. 続きを読む
Side effects of zyban http. - Quit smoking zyban http. (2010年3月 4日 10:57)
Zyban. Quit smoking zyban http. Zyban chantix http. Zyban tablets http. 続きを読む
Zyban versus nrt http. - Side effects of zyban http. (2010年3月 5日 00:44)
Zyban. Zyban versus nrt http. Zyban chantix http. Quitting smoking zyban. 続きを読む
Actos. - Mechanism of action of actos. (2010年3月 5日 13:38)
Actos class action. 続きを読む
Actos. - Actos. (2010年3月 6日 02:50)
What company makes actos. Actos juridicos. 続きを読む
Zyban. - Zyban. (2010年3月 8日 09:28)
Wellbutrin zyban. Zyban side affects. Zyban. 続きを読む
Mechanism of action of actos. - Actos ibs. (2010年3月 9日 09:21)
Actos patent. Canada actos. Actos plus. Lantus actos. Actos. 続きを読む
Zyban. - Reviews for zyban for quitting smoking. (2010年3月 9日 18:09)
Side effects to zyban. Zyban. 続きを読む
Actos. - Actos. (2010年3月10日 05:16)
Dangers of actos. Actos autism. Side effects of actos. Actos. Warnings about ... 続きを読む
Quitting smoking zyban. - Zyban. (2010年3月10日 19:53)
Zyban. Side effects of zyban http. Zyban effects. Zyban tablets http. 続きを読む
Actos side effects. - Lantus actos. (2010年3月12日 17:30)
Dangers of actos. Actos autism. Lantus actos. Actos. 続きを読む
Zyban. - Zyban abuse. (2010年3月13日 01:42)
Zyban. Does zyban make you gain or lose weight. Does zyban expire. Risk of ma... 続きを読む
Positives of zyban. - Zyban abuse. (2010年3月13日 17:27)
Does zyban make you gain or lose weight. Tell me about zyban. Zyban abuse. Zy... 続きを読む
Actos. - Actos. (2010年3月14日 01:36)
Riesgo actos delictivos en construccion. New research on actos. Actos. 続きを読む
Side effects to zyban. - Side effects to zyban. (2010年3月14日 16:22)
Risk of male taking zyban and pregnancy. Zyban side affects. Zyban. 続きを読む
Actos. - Fda actos. (2010年3月15日 16:59)
Actos. Actos recall. 続きを読む
How well does actos work. - Actos. (2010年3月18日 11:13)
Actos juridicos. Actos. Actos ibs. Actos for diabetes. Actos lawsuit. Actos p... 続きを読む
Actos free to physicians. - Actos juridicos. (2010年3月18日 22:53)
Actos diabetes medicine. Actos linguisticos. Actos patent. Sitagliptin and ac... 続きを読む
Actos. - New research on actos. (2010年3月19日 14:14)
Actos. 続きを読む
What is zyban. - Zyban abuse. (2010年3月20日 02:31)
Tell me about zyban. Zyban abuse. Zyban. 続きを読む
Lantus actos. - Actos. (2010年3月20日 02:42)
Actos weight gain. Actos medication. Dangers of actos. Actos juridicos. Actos. 続きを読む
Sitagliptin and actos. - New research on actos. (2010年3月21日 03:00)
Actos cost 30 day supply. Sitagliptin and actos. Actos. 続きを読む
Vicodin. - Effects of vicodin. (2010年3月23日 07:20)
Vicodin and no consults and no prescription. 続きを読む
Hydrocodone addiction. - Hydrocodone online. (2010年3月25日 09:57)
Hydrocodone. Buy hydrocodone online consultation. Difference between hydrocod... 続きを読む
月別アーカイブ
Copyright (C) 2004-2010 Nihon Unisys, Ltd. All Rights Reserved.
Powered by Movable Type Open Source