From 90ba48cdb81acbcb30531863e81352b9f27bcf04 Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 26 May 2011 18:16:20 +0000 Subject: [PATCH] add support for skiptables git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9698 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/sbin/restorexCATdb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/xCAT-client/sbin/restorexCATdb b/xCAT-client/sbin/restorexCATdb index 7d5ae8a3d..9f4bf5f5f 100644 --- a/xCAT-client/sbin/restorexCATdb +++ b/xCAT-client/sbin/restorexCATdb @@ -42,6 +42,13 @@ if ($? != 0) xCAT::MsgUtils->message("E", $msg); exit 1; } +# read tables to skip during restore from site.skiptables attribute +my @output2=xCAT::Utils->get_site_attribute('skiptables'); +my @skiptbls; +if (@output2) { + @skiptbls = split (/\,/,$output2[0]); +} + my @files = readdir(DIRPATH); foreach my $table (@files) { @@ -64,6 +71,17 @@ foreach my $table (@files) } next; } + # skip and table in the site.skiptables attribute + if (@skiptbls) { + my ($tmptable,$suffix) = split(/\./,$table); + chomp $tmptable; + if (grep(/^$tmptable$/, @skiptbls)) { + if ($::VERBOSEREST) { + xCAT::MsgUtils->message("I", "Skipping $tmptable\n"); + } + next; + } + } my $cmd = "tabrestore $tablename"; my @errout = xCAT::Utils->runcmd($cmd, 0);