mhearse has asked for the wisdom of the Perl Monks concerning the following question:
my $current_date = strftime("%Y-%m-%d", localtime); my $current_time = strftime("%H:%M:%S", localtime); my $dumpfile = '>/backups/table_dumps/' . $db . '.' . $current_date . '.' . $current_time; my $valid_table_list = join ' ', @valid_tables; my $cmd = 'mysqldump -q --single-transaction --complete-insert -e' . ' ' . $db . ' ' . $valid_table_list . ' |'; open DUMPFILE, $dumpfile or die $!, open MYSQLDUMP, $cmd or die $!; while (my $bytes_read = read(MYSQLDUMP, my $buffer, 4096)) { print DUMPFILE $buffer; } close DUMPFILE; debug(qq{Finished dumping $db\n\n});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading command output buffer
by jasonk (Parson) on May 09, 2008 at 19:07 UTC | |
|
Re: Reading command output buffer
by starbolin (Hermit) on May 10, 2008 at 02:21 UTC | |
by mhearse (Chaplain) on May 12, 2008 at 05:24 UTC | |
|
Re: Reading command output buffer
by apl (Monsignor) on May 09, 2008 at 19:21 UTC | |
by Fletch (Bishop) on May 09, 2008 at 19:57 UTC |