SHARE
TWEET

Untitled

a guest May 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. SELECT="*.tar.*"
  4. DIR="$HOME/logi_arch"
  5.  
  6. if [ ! -d $DIR ]; then
  7.   mkdir $DIR
  8. fi
  9. rm -rf "$DIR/*"
  10.  
  11. for strona in ~/domains/*
  12. do
  13.     echo $strona
  14.     cd "$strona/"
  15.  
  16.     nazwa=${PWD##*/}
  17.     echo $nazwa
  18.    
  19.     mkdir "$DIR/$nazwa"
  20.  
  21.     cd logs/
  22.     for file in $SELECT
  23.     do
  24.         echo $file
  25.         tar -xzf $file
  26.         mv "$nazwa.error.log.1" $DIR/$nazwa/$(date -r $nazwa.error.log.1 +%y%m%d)_$nazwa.error.log
  27.         mv "$nazwa.log.1" $DIR/$nazwa/$(date -r $nazwa.log.1 +%y%m%d)_$nazwa.log
  28.     done
  29.     cd ../..
  30. done
  31.  
  32. rsync -av -e "ssh -i ~/.ssh/rsa_loganalyzer" $DIR pzbs-rsync@mc.ljasinski.pl:/var/www/dev/00_public_html/log/logs/
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top