From 01ec2d24ecba305a6cc29b464789cdbd461440ea Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 19 Apr 2011 13:38:57 +0000 Subject: [PATCH] dump eventlog and auditlog only with -a flag, dump no x_teal tables git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9347 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/sbin/dumpxCATdb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xCAT-client/sbin/dumpxCATdb b/xCAT-client/sbin/dumpxCATdb index 96aae7a40..032c5bc84 100644 --- a/xCAT-client/sbin/dumpxCATdb +++ b/xCAT-client/sbin/dumpxCATdb @@ -42,6 +42,21 @@ if ($::RUNCMD_RC != 0) } foreach my $table (@output) { + # if not -a request , skip eventlog and auditlog + if ( (!$::ALL) && (($table =~ /^eventlog/) || ($table =~ /^auditlog/))) { + if ($::DUMPVERBOSE) { + xCAT::MsgUtils->message("I", "Skipping $table\n"); + } + next; + } + # skip teal tables + if ( $table =~ /^x_teal/ ) { + if ($::DUMPVERBOSE) { + xCAT::MsgUtils->message("I", "Skipping $table\n"); + } + next; + } + $cmd = "tabdump $table > $::PATH/$table.csv"; my @errout = xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) @@ -70,12 +85,13 @@ sub parse_args { my $msg; my $usagemsg = - " dumpxCATdb -h \n dumpxCATdb -v \n dumpxCATdb [-V] <-p> [path to dump directory]"; + " dumpxCATdb -h \n dumpxCATdb -v \n dumpxCATdb [-a] [-V] <-p> [path to dump directory]"; Getopt::Long::Configure("posix_default"); Getopt::Long::Configure("no_gnu_compat"); Getopt::Long::Configure("bundling"); if ( !GetOptions( + 'a|all' => \$::ALL, 'p|path=s' => \$::PATH, 'h|help' => \$::HELP, 'V|verbose' => \$::DUMPVERBOSE,