Skip to content

Instantly share code, notes, and snippets.

@riywo
Created March 14, 2011 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riywo/868772 to your computer and use it in GitHub Desktop.
Save riywo/868772 to your computer and use it in GitHub Desktop.
innobackupexでログにパスワードを生で吐かない様に
# diff -u /usr/bin/innobackupex-1.5.1 innobackupex-1.5.1
--- /usr/bin/innobackupex-1.5.1 2010-11-12 16:13:38.000000000 +0900
+++ innobackupex-1.5.1 2011-03-14 13:17:24.000000000 +0900
@@ -1134,7 +1134,8 @@
my $options = get_mysql_options();
# run mysql as a child process with a pipe connection
$now = current_time();
- print STDERR "$now $prefix Starting mysql with options: $options\n";
+ (my $prt_options = $options) =~ s/--password=[^ ]+ /--password=xxxxxxxx /g;
+ print STDERR "$now $prefix Starting mysql with options: $prt_options\n";
$mysql_pid = open(*MYSQL_WRITER, "| mysql $options >$mysql_stdout 2>$mysql_stderr ") or Die "Failed to spawn mysql child process: $!";
MYSQL_WRITER->autoflush(1);
$now = current_time();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment