Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
rb:compresslogfiles [10/10/2013 14:21]
127.0.0.1 external edit
rb:compresslogfiles [05/09/2019 10:34] (current)
andrew
Line 12: Line 12:
  
  
-  [works@gy-asp-log01 scripts]$ more compresslogfiles.sh+  [works@log01 scripts]$ more compresslogfiles.sh
   #​!/​bin/​bash ​                     #​!/​bin/​bash ​                  
                                                                                                                                                                                                                                                                                                                                    
-  #Written Andrew ​Stringer ​28 September 2012 to compress log files on srv-log01 ​                    +  #Written Andrew ​28 September 2012 to compress log files on srv-log01 ​                    
                                                                                                                                                                                                                                                                                                                                    
   #turn on debugging, -x starts, +x stops   #turn on debugging, -x starts, +x stops
Line 25: Line 25:
   SENDEMAIL=3   SENDEMAIL=3
   #​EMAIL=ww@zzz.com   #​EMAIL=ww@zzz.com
-  EMAIL=andrew.stringer@zzz.com+  EMAIL=andrew.xx@zzz.com
   ​   ​
   ​   ​
Line 36: Line 36:
   ​   ​
   #Check user is works   #Check user is works
-  if [ "​${USER}"​ = "works" ]; then +  if [ "​${USER}"​ = "logworks" ]; then 
-     echo "​Running as user works" ​ >> ${TMPLOG}+     echo "​Running as user logworks" ​ >> ${TMPLOG}
      echo " " ​ >> ${TMPLOG}      echo " " ​ >> ${TMPLOG}
      else      else
-     echo "​Sorry,​ you need to be the works user to run this script."​+     echo "​Sorry,​ you need to be the logworks ​user to run this script."​
      exit 1      exit 1
   fi   fi
Line 57: Line 57:
   echo "​================================"​ >> ${TMPLOG}   echo "​================================"​ >> ${TMPLOG}
   echo ""​ >> ${TMPLOG}   echo ""​ >> ${TMPLOG}
-  echo "From /home/works/​scripts/​compresslogfiles.sh on srv-log01"​ >> ${TMPLOG}+  echo "From /home/logworks/​scripts/​compresslogfiles.sh on srv-log01"​ >> ${TMPLOG}
   echo ""​ >> ${TMPLOG};   echo ""​ >> ${TMPLOG};
   echo ""​ >> ${TMPLOG};   echo ""​ >> ${TMPLOG};
Line 69: Line 69:
   ​   ​
   ​   ​
-  #find /var/log/GRY/​app/​srv-app01/​ -maxdepth 1 -type f -exec bzip2 {} \;+  #find /​var/​log/​app/​srv-app01/​ -maxdepth 1 -type f -exec bzip2 {} \;
   ​   ​
   #set up some counters   #set up some counters
Line 174: Line 174:
   ​   ​
   #from df   #from df
-  SPACEATEND=`df -h | grep /var/log/GRS | cut -d' ' -f28`+  SPACEATEND=`df -h | grep /var/log | cut -d' ' -f28`
   ​   ​
   echo "​Returncode is >​${RESULT}<"​ >> ${TMPLOG}   echo "​Returncode is >​${RESULT}<"​ >> ${TMPLOG}

rb/compresslogfiles.txt · Last modified: 05/09/2019 10:34 by andrew