Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What does this line " cd `ls |grep -v tar`/disks" here????
Code:
-bash-3.00$ /usr/local/bin/sudo cat /users/sysmgr/ios
Password:
#!/usr/bin/bash
cd /opt/SUNWexplo/output/
cd `ls |grep -v tar`/disks
echo `pwd`
cp iostat_-E.out /users/sysmgr/ionew
diff /users/sysmgr/ionew/iostat_-E.out /users/sysmgr/ioold/iostat_-E.out >/users/sysmgr/iodiff
if [ -s /users/sysmgr/iodiff ]
then
echo
else
echo `pwd`
cat /dev/null >iostat_-E.out
cd /opt/SUNWexplo/output
echo `pwd`
rm -f `ls |grep explorer.844d540d.server1|grep tar`
h=`ls |grep -v tar`
tar cvf $h.tar $h
gzip $h.tar
fi
cp /users/sysmgr/ionew/iostat_-E.out /users/sysmgr/ioold
-bash-3.00$
it showing me this errors:-
Code:
Your "cron" job on server1
/usr/local/bin/sudo /users/sysmgr/ios #HD404710
produced the following output:
/opt/SUNWexplo/output/explorer.844d540d.server1-2013.08.26.00.00
cp: cannot access iostat_-E.out
/opt/SUNWexplo/output/explorer.844d540d.server1-2013.08.26.00.00
/opt/SUNWexplo/output
tar: explorer.844d540d.server1-2013.08.26.00.00: Is a directory
gzip: explorer.844d540d.server1-2013.08.26.00.00 is a directory -- ignored
gzip: iostat_-E.out.gz already has .gz suffix -- unchanged
gzip: stderr.21762.tar: No such file or directory
EDIT:--
This what I have in /opt/SUNWexplo/output/
Code:
-bash-3.00$ cd /opt/SUNWexplo/output/
-bash-3.00$ ls -la
total 12
drwxr-xr-x 3 root bin 512 Aug 27 14:50 .
drwxr-xr-x 12 root bin 512 Jul 31 12:25 ..
-r-------- 1 root root 11 Jul 29 02:06 .explastrun
drwx------ 20 root root 512 Aug 27 14:50 explorer.844d540d.amspdmbep31-2013.08.27.07.02
-rw-r--r-- 1 root root 34 Aug 19 02:45 iostat_-E.out.gz
-rw------- 1 root root 88 Jun 25 10:30 stderr.21762
-bash-3.00$
Last edited by manalisharmabe; 08-27-2013 at 09:48 AM.
This how it produces output when it runs well on other server.
Code:
Your "cron" job on server2
/usr/local/bin/sudo /users/sysmgr/ios # HD 404710
produced the following output:
/opt/SUNWexplo/output/explorer.833c0503.server2-2013.08.26.00.00/disks
/opt/SUNWexplo/output/explorer.833c0503.server2-2013.08.26.00.00/disks
/opt/SUNWexplo/output
a explorer.833c0503.server2-2013.08.26.00.00/ 0K
a explorer.833c0503.server2-2013.08.26.00.00/rda/ 0K
a explorer.833c0503.server2-2013.08.26.00.00/rda/RDA.log 6K
a explorer.833c0503.server2-2013.08.26.00.00/rda/collect/ 0K
a explorer.833c0503.server2-2013.08.26.00.00/rda/collect/EXPLORER_XPLR_ptch_z_global.txt 189K
a explorer.833c0503.server2-2013.08.26.00.00/rda/collect/EXPLORER_XPLR_pkg_z_global.txt 1545K
a explorer.833c0503.server2-2013.08.26.00.00/rda/collect/EXPLORER_XPLR_cfg_z_global.txt 1645K
Above are just starting few lines of big output of that script.
Last edited by manalisharmabe; 08-27-2013 at 10:07 AM.
Result of a buggy script... you should always make sure the file or dir exists and has sufficient read and write permissions prior to use them anywhere in the script.
So above cp erroris because of insufficient permissions on the file.
Quote:
tar: explorer.844d540d.server1-2013.08.26.00.00: Is a directory
gzip: explorer.844d540d.server1-2013.08.26.00.00 is a directory -- ignored
gzip: iostat_-E.out.gz already has .gz suffix -- unchanged
gzip: stderr.21762.tar: No such file or directory
Again not checked for a file and nor for existing archive.
EDIT:
assuming you dont have sufficient permisions to change the script... so for this to work fine you have to apply correct permissions on the file "*.out" and and rename the .gz file to something else. That should be it.
[QUOTE=SAbhi;5016930]Result of a buggy script... you should always make sure the file or dir exists and has sufficient read and write permissions prior to use them anywhere in the script.
NO. this scripts works fine on other solaris 10 server.
this script has started giving errors when we upgraded Sun Explorer version from 7.3 to 8.0. on this machine.
Last edited by manalisharmabe; 08-28-2013 at 01:16 AM.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Then downgrade explorer to 7.3 or upgrade your script to something that work with explorer 8.0.
If there is no such update, find out the people who wrote the script and ask them for support.
If not available, figure out why and what something changed in the directory layout between the explorer releases.
NO. this scripts works fine on other solaris 10 server.
this script has started giving errors when we upgraded Sun Explorer version from 7.3 to 8.0. on this machine.
Actually the script is sure a buggy script.. reasons i have already mentioned in the last post... it was working fine on other servers because they have the required file and permissions set already and hence it executed.. while when you upgraded a server and it dont have the required sets of permissions and already a archive present, the script should have statements checking that..
for the solution i already have mentioned in EDIT section of last comment.
Warning:
I have never used solaris.
The below is Untested...even on gnu/linux
may use 'features' not available to you
no real error checking/reporting..
Whenever i run this comand /usr/local/bin/sudo /users/sysmgr/ios on command line only
this line /opt/SUNWexplo/output/explorer.833b0e87.server1-2013.09.16.00.00/disks get produced but when I again run it, it get executed fully like this:-
Code:
opt/SUNWexplo/output/explorer.833c0503.server1-2013.09.16.00.00/disks
/opt/SUNWexplo/output/explorer.833c0503.server1-2013.09.16.00.00/disks
/opt/SUNWexplo/output
a explorer.833c0503.server1-2013.09.16.00.00/ 0K
a explorer.833c0503.server1-2013.09.16.00.00/rda/ 0K
a explorer.833c0503.server1-2013.09.16.00.00/rda/RDA.log 6K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/ 0K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_ptch_z_global.txt 189K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_pkg_z_global.txt 1545K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_cfg_z_global.txt 1646K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_R00006_sysconfig_lutab.lin 1K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_R00007_sysconfig_drv_aac_conf.lin 1K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_R00008_sysconfig_drv_aggr_conf.lin 1K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_R00009_sysconfig_drv_arp_conf.lin 1K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_R00010_sysconfig_drv_audio1575_conf.lin 2K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_R00011_sysconfig_drv_audiocs_conf.lin 2K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_R00012_sysconfig_drv_audioens_conf.lin 2K
a explorer.833c0503.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_R00013_sysconfig_drv_audiots_conf.lin 2K
In first attempt this is how it attempts in mail in first attempt:-
Code:
Your "cron" job on server1
/usr/local/bin/sudo /users/sysmgr/ios
produced the following output:
/opt/SUNWexplo/output/explorer.833b0e87.server1-2013.09.16.00.00/disks
What could be the problem that it does not hget executed in first run?
Does it mean that it does not send system information to Sun Explorer Portal?
Well, After first run I did check /opt/SUNWexplo/output folder but nothing speacial get created there.
Please advise.
Last edited by manalisharmabe; 09-17-2013 at 12:13 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.