Sponsored Content
Top Forums Shell Programming and Scripting Problem with a script on a solaris 10 box Post 302420859 by gnom on Wednesday 12th of May 2010 06:03:17 PM
Old 05-12-2010
Problem with a script on a solaris 10 box

Hi Gurus
I have several SAN's in two different locations. I collect performance data and archive them. In one location the archiving script runs on a solaris 9 server and in the other on a solaris 10 server. But the script fails every day on the solaris 10 server with this
Code:
mes6=`/usr/bin/du -sk *${yesterday}* | /usr/bin/awk '{print $1}'`

I tried everything, even a redirect to a /tmp/output.txt to see what the output is. It is always 0

Code:
#!/usr/bin/sh

date=`date +'%Y%m%d'`
#yesterday=`expr $date - 1`
yesterday=`perl -e '@T=localtime(time-86400);printf("%02d%02d%02d",$T[5]+1900,$T[4]+1,$T[3])'`
dir=`date +'%m%y'`
host=`uname -n`

set -x
test ! -d $dir && mkdir $dir

cd /var/tmp/performance/controller
tar cvf controller_$yesterday.tar *${yesterday}*.txt
        mes1=`tar tvf controller_$yesterday.tar | wc -l`
/usr/bin/gzip *.tar
test ! -d archive/$dir && mkdir archive/$dir
/usr/bin/mv *.tar.gz archive/$dir/
        cd archive/$dir
        mes4=`du -sk *${yesterday}* | awk '{print $1}'`
cd /var/tmp/performance/controller
rm *${yesterday}*.txt

cd /var/tmp/performance/volume
tar cvf volume_$yesterday.tar *${yesterday}*.txt
        mes2=`tar tvf volume_$yesterday.tar | wc -l`
/usr/bin/gzip *.tar
test ! -d archive/$dir && mkdir archive/$dir
/usr/bin/mv *.tar.gz archive/$dir/
        cd archive/$dir
        mes5=`du -sk *${yesterday}* | awk '{print $1}'`
cd /var/tmp/performance/volume
rm *${yesterday}*.txt

cd /var/tmp/performance/array
tar cvf array_$yesterday.tar *${yesterday}*.txt
        mes3=`tar tvf array_$yesterday.tar | wc -l`
/usr/bin/gzip *.tar
test ! -d archive/$dir && mkdir archive/$dir
/usr/bin/mv *.tar.gz archive/$dir/
        cd archive/$dir
        mes6=`/usr/bin/du -sk *${yesterday}* | /usr/bin/awk '{print $1}'`
        echo $mes6 >> /tmp/output.txt
cd /var/tmp/performance/array
rm *${yesterday}*.txt

#send a webops message if too less files
if [ $mes1 -lt 720 ]; then
        /usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes1 controller messages on $host, check script"
fi

if [ $mes2 -lt 720 ]; then
        /usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes2 volume messages on $host, check script"
fi


if [ $mes3 -lt 720 ]; then
        /usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes3 array messages on $host, check script"
fi

#send a webops message if .tar.gz is too small in size
if [ $mes4 -lt 250 ]; then
        /usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes4 kb controller messages on $host, check script" 
fi

if [ $mes5 -lt 250 ]; then
        /usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes5 kb volume messages on $host, check script"
fi

if [ $mes6 -lt 33 ]; then
        /usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes6 kb array messages on $host, check script"
fi

So I have everyday webops messages and tickets.

Can you tell me whats wrong? Is it a problem with the solaris 10 server? On the solaris 9 server it runs without any probem.

Thanks in advance for your input.
gnom
 

10 More Discussions You Might Find Interesting

1. Solaris

Error on Solaris box

We are getting the following error: warning: pm: Can't set power level of TSI, gfxp to level 0 The machine is running Solaris 8. I think it is a SUn 220R box. Any ideas what this means? (2 Replies)
Discussion started by: hshapiro
2 Replies

2. Shell Programming and Scripting

Script to Reboot a linux box from a windows box

HI All, I need a script to reboot a linux box from a windows box. The script needs to run automatically whenever a sitescope alerts with an error message. Have searched for this in the forums, but could not get something relative. Pls. let me know the various alternatives we have to do... (2 Replies)
Discussion started by: Crazy_murli
2 Replies

3. UNIX for Dummies Questions & Answers

difference between AIX box and Sun Solaris box

Hi, I need a clarification. Is there any difference between AIX box and Sun Solaris box? The bzip command with -c option works in AIX box and the same does not work in Sun Solaris box. Can anyone please explain if there is an implementation difference in both these boxes for the shell... (1 Reply)
Discussion started by: nisha4680
1 Replies

4. Shell Programming and Scripting

Box A's perl script calling box B's shell script

Hi all, i have a perl script one server. I am running a cronjob to execute my perl script. #! /usr/bin/perl ... ... ... #call a shell script on another server How can i accomplish #? Do i have to issue a system (" ssh -l username server | shellscript.sh") in my shell script? or is there a... (1 Reply)
Discussion started by: new2ss
1 Replies

5. Shell Programming and Scripting

calling a unix script in one box from another box

i have a unix script which is available in a box say box1 i want this script to be run in box box2 and put the output file in box2 what is the procedure to execute this script in box2 i will call the script in box1 using cybermation (1 Reply)
Discussion started by: trichyselva
1 Replies

6. Shell Programming and Scripting

sftp script needed for solaris box

Hi , I have a solaris box through which i need to connect to ATM's and pull files using sftp. I did same type of scripting using ftp before but no sftp.The problem now i am facing is, i want to put the password along with this sftp (non-interactive) script. Unfortunately there is no... (3 Replies)
Discussion started by: Renjesh
3 Replies

7. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

8. Solaris

E1 on Solaris box

hi, can someone please guide me if there is any special hardware to use when we need to terminate an E1/T1 link on a Solaris10 box. I have a number of boxes and these all are located at longer distances. the only connectivity is the E1 links between these far location locations. Would it be... (0 Replies)
Discussion started by: busyboy
0 Replies

9. Shell Programming and Scripting

Need a script to add mutiple printers in solaris box

Hi , i need to configure around 80 printers in a server. can someone please help me with the script. i have a file that has printer name and its ip. like. printer1 1.1.1.1 printer2 0.0.0.0 and so on.. can some one please help me to do it via script. i am using solaris 10 ... (0 Replies)
Discussion started by: chidori
0 Replies

10. Shell Programming and Scripting

Notify when the script run(hourly)on my jump-box only when there is a failure on my remote-box

Team, Presently I have a script, which i have set up cron on one of my Jump-boxes,and gives me the output on every hourly basis,fetching the data from the remote machine.Basically it gives me the list of all active users logged and its count once we execute the script.Here the count is... (6 Replies)
Discussion started by: whizkidash
6 Replies
GIT-TAR-TREE(1) 						    Git Manual							   GIT-TAR-TREE(1)

NAME
git-tar-tree - Create a tar archive of the files in the named tree object SYNOPSIS
git tar-tree [--remote=<repo>] <tree-ish> [ <base> ] DESCRIPTION
THIS COMMAND IS DEPRECATED. Use git archive with --format=tar option instead (and move the <base> argument to --prefix=base/). Creates a tar archive containing the tree structure for the named tree. When <base> is specified it is added as a leading path to the files in the generated tar archive. git tar-tree behaves differently when given a tree ID versus when given a commit ID or tag ID. In the first case the current time is used as modification time of each file in the archive. In the latter case the commit time as recorded in the referenced commit object is used instead. Additionally the commit ID is stored in a global extended pax header. It can be extracted using git get-tar-commit-id. OPTIONS
<tree-ish> The tree or commit to produce tar archive for. If it is the object name of a commit object. <base> Leading path to the files in the resulting tar archive. --remote=<repo> Instead of making a tar archive from local repository, retrieve a tar archive from a remote repository. CONFIGURATION
tar.umask This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the world write bit. The special value "user" indicates that the archiving user's umask will be used instead. See umask(2) for details. EXAMPLES
git tar-tree HEAD junk | (cd /var/tmp/ && tar xf -) Create a tar archive that contains the contents of the latest commit on the current branch, and extracts it in /var/tmp/junk directory. git tar-tree v1.4.0 git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release. git tar-tree v1.4.0^{tree} git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release, but without a global extended pax header. git tar-tree --remote=example.com:git.git v1.4.0 >git-1.4.0.tar Get a tarball v1.4.0 from example.com. git tar-tree HEAD:Documentation/ git-docs > git-1.4.0-docs.tar Put everything in the current head's Documentation/ directory into git-1.4.0-docs.tar, with the prefix git-docs/. GIT
Part of the git(1) suite Git 1.8.5.3 01/14/2014 GIT-TAR-TREE(1)
All times are GMT -4. The time now is 05:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy