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; }