--- db/prgsrc/db.cgi 2000/10/21 04:25:22 1.8 +++ db/prgsrc/db.cgi 2000/10/23 01:23:35 1.9 @@ -10,6 +10,7 @@ my ($PWD) = `pwd`; chomp $PWD; my ($SRCPATH) = "$PWD/../dimrub/src"; my ($ZIP) = "/home/piataev/bin/zip"; +my $DUMPFILE = /tmp/dump.sql my ($SENDMAIL) = "/usr/sbin/sendmail"; my ($TMSECS) = 30*24*60*60; my (%RevMonths) = @@ -634,17 +635,31 @@ EOT } elsif (param('from_year') && param('to_year')) { print &PrintDates($dbh); } elsif (param('comp')) { - print header( - -'Content-Type' => 'application/x-zip-compressed; name="db.zip"', - -'Content-Disposition' => 'attachment; filename="db.zip"' - ); - $tour = (param('tour')) ? param('tour') : 0; - my (@files) = &PrintArchive($dbh, $tour); - open F, "$ZIP -j - $SRCPATH/COPYRIGHT @files |"; - print (); - close F; - $dbh->disconnect; - exit; + print header( + -'Content-Type' => 'application/x-zip-compressed; name="db.zip"', + -'Content-Disposition' => 'attachment; filename="db.zip"' + ); + $tour = (param('tour')) ? param('tour') : 0; + my (@files) = &PrintArchive($dbh, $tour); + open F, "$ZIP -j - $SRCPATH/COPYRIGHT @files |"; + print (); + close F; + $dbh->disconnect; + exit; + } elsif (param('sqldump')) { + print header( + -'Content-Type' => 'application/x-zip-compressed; name="dump.zip"', + -'Content-Disposition' => 'attachment; filename="dump.zip"' + ); + if (! -f $DUMPFILE) { + `mysqldump -u piataev chgk > $DUMPFILE`; + } + open F, "$ZIP -j - $DUMPFILE |"; + print (); + close F; + $dbh->disconnect; + exit; + } else { $tour = (param('tour')) ? param('tour') : 0; if ($tour !~ /^[0-9]*$/) {