LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This 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


Reply
  Search this Thread
Old 09-17-2013, 02:26 AM   #16
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1

Here is the crontab entry:-

Code:
bash-3.00$ /usr/local/bin/sudo crontab -l sysmgr
Password:
00 02 * * 1     /usr/local/bin/sudo /opt/SUNWexplo/bin/explorer -P -q # SUNWexplo
45 02 * * 1     /usr/local/bin/sudo /users/sysmgr/ios  
45 02 * * 1     /usr/local/bin/sudo  find /opt/SUNWexplo/output/ -name  "explorer*`uname -n`*" -exec chmod -R 755 {} \; > /dev/null 2>&1
59 02 * * 1     scp -q /opt/SUNWexplo/output/*.tar.gz 10.10.10.12:/opt/lisa/explorers/ 2>&1|nawk '! /^$|^\*/'
00 06 * * *     /usr/local/bin/sudo /usr/sbin/fmadm faulty -a
My question is when I run this /usr/local/bin/sudo /users/sysmgr/ios on command line only this diplays as output
/opt/SUNWexplo/output/explorer.844d540d.Server1-2013.09.16.00.00/disks

But when I execute it second time then all outputs comes.

this what you need:-
Code:
-bash-3.00$ ls -l explorer.844d540d.amspdmbep31-2013.09.16.00.00/disks
total 708
-rwxr-xr-x   1 root     root       12714 Sep 16 02:07 dev-lL.err
-rwxr-xr-x   1 root     root       58151 Sep 16 02:07 dev-lL.out
-rwxr-xr-x   1 root     root        1196 Sep 16 02:07 df-al.out
-rwxr-xr-x   1 root     root        1196 Sep 16 02:07 df-alZ.out
-rwxr-xr-x   1 root     root         560 Sep 16 02:07 df-el.out
-rwxr-xr-x   1 root     root         560 Sep 16 02:07 df-elZ.out
-rwxr-xr-x   1 root     root        4684 Sep 16 02:07 df-gl.out
-rwxr-xr-x   1 root     root        4684 Sep 16 02:07 df-glZ.out
-rwxr-xr-x   1 root     root        1201 Sep 16 02:07 df-kl.out
-rwxr-xr-x   1 root     root        1201 Sep 16 02:07 df-klZ.out
-rwxr-xr-x   1 root     root         746 Sep 16 02:07 diskinfo
-rwxr-xr-x   1 root     root          32 Sep 16 02:07 diskinfo.err
-rwxr-xr-x   1 root     root        1283 Sep 16 02:07 format.out
-rwxr-xr-x   1 root     root        3102 Sep 16 02:07 iostat_-E.out
-rwxr-xr-x   1 root     root       11773 Sep 16 02:07 iostat_-xpnc_3_3.out
-rwxr-xr-x   1 root     root        3493 Sep 16 02:07 iostat-iE.out
drwxr-xr-x   2 root     root         512 Sep 16 02:08 iscsi
-rwxr-xr-x   1 root     root      183523 Sep 16 02:07 ls_-lAR_@dev_@devices.out
-rwxr-xr-x   1 root     root         368 Sep 16 02:07 ls-l_dev_cfg.out
-rwxr-xr-x   1 root     root       11730 Sep 16 02:07 ls-l_dev_rdsk.out
-rwxr-xr-x   1 root     root           8 Sep 16 02:07 ls-l_dev_rmt.out
-rwxr-xr-x   1 root     root          59 Sep 16 02:07 ls-ld_tmp.out
-rwxr-xr-x   1 root     root           8 Sep 16 02:07 ls-lL_dev_rmt.out
-rwxr-xr-x   1 root     root          71 Sep 16 02:07 luxadm_fcode_download_-p.err
-rwxr-xr-x   1 root     root         130 Sep 16 02:07 luxadm_fcode_download_-p.out
-rwxr-xr-x   1 root     root          24 Sep 16 02:07 luxadm_probe_-p.err
-rwxr-xr-x   1 root     root          45 Sep 16 02:07 luxadm_probe_-p.out
-rwxr-xr-x   1 root     root          24 Sep 16 02:07 luxadm_probe.err
-rwxr-xr-x   1 root     root          45 Sep 16 02:07 luxadm_probe.out
-rwxr-xr-x   1 root     root          64 Sep 16 02:07 luxadm_qlgc_s_download.out
-rwxr-xr-x   1 root     root          38 Sep 16 02:07 maj_min_dev_num.err
-rwxr-xr-x   1 root     root           0 Sep 16 02:07 maj_min_dev_num.out
-rwxr-xr-x   1 root     root        1783 Sep 16 02:07 mount-v.out
-rwxr-xr-x   1 root     root        1629 Sep 16 02:07 mount.out
drwxr-xr-x   2 root     root         512 Sep 16 02:08 mpathadm
drwxr-xr-x   2 root     root         512 Sep 16 02:08 prtvtoc
-rwxr-xr-x   1 root     sys        12412 Mar 17  2009 st.conf
drwxr-xr-x   3 root     root         512 Sep 16 02:08 svm
-rwxr-xr-x   1 root     root          98 Sep 16 02:07 swap-l.out
-rwxr-xr-x   1 root     root          87 Sep 16 02:07 swap-s.out
drwxr-xr-x   2 root     root         512 Sep 16 02:08 ufs
-bash-3.00$ cd explorer.844d540d.amspdmbep31-2013.09.16.00.00
Thanks.
 
Old 09-17-2013, 04:15 AM   #17
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
Quote:
45 02 * * 1 /usr/local/bin/sudo /users/sysmgr/ios
45 02 * * 1 /usr/local/bin/sudo find /opt/SUNWexplo/output/ -name "explorer*`uname -n`*" -exec chmod -R 755 {} \; > /dev/null 2>&1
here is the reason :

the first line mentioned above is actually producing the single line output and the long output that you are getting is because of the second line that is executing in parallel to the first one.

EDIT:
Try running this command [CODE /usr/local/bin/sudo /users/sysmgr/ios[/CODE] in a seperate terminal and observe the output.

Last edited by SAbhi; 09-17-2013 at 04:19 AM.
 
Old 09-17-2013, 04:48 AM   #18
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
yes, Thanks for reply.
I dont think the problem is with second line.

I am talking only about below output:-
Code:
bash-3.00$ /usr/local/bin/sudo /users/sysmgr/ios
Password:
/opt/SUNWexplo/output/explorer.844d540d.server1-2013.09.16.00.00/disks

-bash-3.00$ /usr/local/bin/sudo /users/sysmgr/ios | more
/opt/SUNWexplo/output/explorer.844d540d.server1-2013.09.16.00.00/disks
/opt/SUNWexplo/output/explorer.844d540d.server1-2013.09.16.00.00/disks
/opt/SUNWexplo/output
a explorer.844d540d.server1-2013.09.16.00.00/ 0K
a explorer.844d540d.server1-2013.09.16.00.00/rda/ 0K
a explorer.844d540d.server1-2013.09.16.00.00/rda/RDA.log 6K
a explorer.844d540d.server1-2013.09.16.00.00/rda/collect/ 0K
a explorer.844d540d.server1-2013.09.16.00.00/rda/collect/RDA_CONFIG_homes.txt 1K
a explorer.844d540d.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_ptch_z_global.txt 179K
a explorer.844d540d.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_pkg_z_global.txt 1553K
a explorer.844d540d.server1-2013.09.16.00.00/rda/collect/EXPLORER_XPLR_cfg_z_global.txt 187



In red line it just produces one line output but in second blue line it produces big output only on command line
This what I want to know WHY SO?
Why in the second attempt the same command produces big output?

Thanks.

Last edited by manalisharmabe; 09-17-2013 at 04:50 AM.
 
Old 09-17-2013, 07:11 AM   #19
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you may try to insert set -xv at the beginning of the script and you will see what's happening
 
1 members found this post helpful.
Old 09-17-2013, 10:03 AM   #20
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by pan64 View Post
you may try to insert set -xv at the beginning of the script and you will see what's happening
Thanks for reply!

What xv means? v for verbose, but x ?

Are you saying like this

Code:
/usr/local/bin/sudo -xv /users/sysmgr/ios
or
Code:
/usr/local/bin/sudo /users/sysmgr/ios -xv
?

Thanks.
 
Old 09-17-2013, 10:04 AM   #21
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
[QUOTE=manalisharmabe;5029234]Thanks for reply!

ok like this

set -xv ?

I will try it.

thanks.
 
Old 09-17-2013, 10:51 AM   #22
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
no, you need to edit the script and add this line:
#!/usr/bin/bash
set -xv


or if it does not work you can execute it as:
sudo bash -xv /users/sysmgr/ios

-v verbose, -x debug info
 
1 members found this post helpful.
Old 09-17-2013, 12:16 PM   #23
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
I will get back to this shortly.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash script - don't understand error itsnew2me Linux - Newbie 4 11-24-2012 07:57 AM
don't understand budbaker44 Linux - Newbie 2 09-02-2009 12:30 PM
Don't Understand melp57 Linux - Newbie 6 11-13-2007 07:14 PM
I don't understand Coimbra Linux - Newbie 2 05-22-2007 05:38 AM
i don't understand... humanveal Linux - Software 17 05-20-2003 03:24 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 08:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration