Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, Anyone can help me on my script to convert these in SOLARIS Script, these would be work in LINUX. Code: ## START HERE ### #!/bin/bash EMAIL_ADDRESS="myemail@company.com" DATE=`/bin/date +%m%d%Y` TIME=`/bin/date ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    2

    URGENT! Solaris File IF Exist and BYTES Validation

    Hi,

    Anyone can help me on my script to convert these in SOLARIS Script, these would be work in LINUX.
    Code:
    ## START HERE ###
    #!/bin/bash
    EMAIL_ADDRESS="myemail@company.com"
    DATE=`/bin/date +%m%d%Y`
    TIME=`/bin/date +%H:%M`
    SUBJECT="The Status was SEND..."
    ROTATE_FILES="/directory/logs"
    REAL_FILE="status.log"
    
    function rotate_files()
    {
      for j in $1;do
      echo "Loop1"
    
      if [ -d $j ]
         then
           for i in `ls -a /$j`
      do
      if [ $i = $ROTATE_FILES/status.log ]
         then
           echo $i
         FILESIZE=`ls -l $i|awk "{print $5}"`
         LIMIT=0
         if [ $FILESIZE -ne 0 ]
            then
              echo "the size is greater"
              mutt -s "$SUBJECT at $TIME on $DATE" -a "$ROTATE_FILES/status.log" "$EMAIL_ADDRESS" < /dev/null
         fi
      fi
      done
    fi
    done
    }
    rotate_files "$ROTATE_FILES"
    ### END HERE ###
    Any help are highly appreciated, thanks in advance.


    Regards
    Last edited by devils casper; 03-19-2009 at 09:51 AM. Reason: Added [code]...[/code] tag.

  2. #2
    Just Joined!
    Join Date
    Mar 2009
    Posts
    2

    Done!

    I done it myself...TNX

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...