From e2b1f70f6bd44cad90b7516e70be4377875872b9 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 20 Jun 2012 11:13:09 +0000 Subject: [PATCH] xdsh -c cleans up both the SNsyncfiledir and the nodesyncfiledir directories on the SN git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13130 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/xdsh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/xCAT-client/bin/xdsh b/xCAT-client/bin/xdsh index d537a7fd4..bb67d85f4 100644 --- a/xCAT-client/bin/xdsh +++ b/xCAT-client/bin/xdsh @@ -268,7 +268,7 @@ sub parse_args_xdsh if ($options{'cleanup'}) { - # get the directory on the servicenode to put the files in + # get the directories on the servicenode to put the files in my $defaultsyndir = "/var/xcat/syncfiles"; my @syndir = xCAT::Utils->get_site_attribute("SNsyncfiledir"); my $synfiledir; @@ -280,11 +280,23 @@ sub parse_args_xdsh { $synfiledir = "/var/xcat/syncfiles"; # default } + # for append function + my $defaultnodesyndir = "/var/xcat/node/syncfiles"; + my @syndir2 = xCAT::Utils->get_site_attribute("nodesyncfiledir"); + my $synfiledir2; + if ($syndir2[0]) + { + $synfiledir2 = $syndir2[0]; + } + else + { + $synfiledir2 = "/var/xcat/node/syncfiles"; # default + } if ($defaultsyndir ne $synfiledir) { my $answer; my $msg = - "Do you wish to erase $synfiledir and all subdirectories?\n Enter Y or N."; + "Do you wish to erase $synfiledir,$synfiledir2 and all subdirectories?\n Enter Y or N."; xCAT::MsgUtils->message('I', "$msg"); `stty -echo`; chop($answer = ); @@ -295,11 +307,11 @@ sub parse_args_xdsh exit 0; } } - my $cmd = "xdsh $snodes -v rm -rf $synfiledir/*"; + my $cmd = "xdsh $snodes -v rm -rf $synfiledir/*;xdsh $snodes -v rm -rf $synfiledir2"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { # error - my $msg = "Error from $cmd: to cleanup servicenodes sync directory"; + my $msg = "Error from $cmd: to cleanup servicenodes"; xCAT::MsgUtils->message("E", $msg); exit 1; }