From 8b6feb6b306311dc415d878a84a636221a9b34b6 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 25 Sep 2013 07:23:16 -0400 Subject: [PATCH] add /install/custom directory --- xCAT-server/sbin/xcatsnap | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xCAT-server/sbin/xcatsnap b/xCAT-server/sbin/xcatsnap index f895d4ea9..500f62b06 100755 --- a/xCAT-server/sbin/xcatsnap +++ b/xCAT-server/sbin/xcatsnap @@ -39,10 +39,18 @@ # This command can only be run by a root user. # #################################################################### - +BEGIN +{ + $::XCATROOT = + $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} + : -d '/opt/xcat' ? '/opt/xcat' + : '/usr'; +} +use lib "$::XCATROOT/lib/perl"; use File::Spec; use Getopt::Long; use strict; +require xCAT::MsgUtils; my $OSname; my @Commands_array; my $Command_name; @@ -193,7 +201,7 @@ sub snap_it { @files_array = ( "/etc/xcat/*","$::ROOTHOME/.xcat/*", "$INSTALLDIR/autoinst/*", - "$INSTALLDIR/postscripts/*", "$INSTALLDIR/prescripts/*", + "$INSTALLDIR/postscripts/*", "$INSTALLDIR/prescripts/*", "$INSTALLDIR/custom/*", "/tftpboot/*", "/var/log/consoles/*", "/etc/*-release", "/etc/dhcpd.conf", "/var/lib/dhcpd/dhcpd.leases", "/etc/hosts", "/etc/resolv.conf", @@ -332,7 +340,11 @@ if ($::HELP ) { exit 0; } if ($::VERSION) { - print " xcatsnap tool version 1.0\n"; + my $version = xCAT::Utils->Version(); + $version .= "\n"; + xCAT::MsgUtils->message("N", $version); + exit 0; + exit 0; }