SHARE
TWEET

Untitled

a guest Aug 12th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. DIR="$( cd "$( dirname "$0" )" && pwd )"
  4. DATETIME="$(date +%Y-%m-%d.%H_%M_%S)"
  5. DIRPATH=/var/www/tools/IMIQ-AdWords-Viewer/data
  6. ARCHIVEPATH=/storage/archiv/IMIQ-AdWords-Viewer
  7. SUBDIRS="errors reports tempreports logs"
  8. LOGFILE=$DIR/log
  9.  
  10. for i in $SUBDIRS; do
  11.    find $DIRPATH/$i -type f -mtime +62 | tee $LOGFILE | xargs tar -cz -f $ARCHI  +++VEPATH/IMIQ-AdWords-Viewer_$i-$DATETIME.tar.gz
  12. done
  13.  
  14. while read line
  15. do
  16.    echo rm -f $line
  17. done < $LOGFILE
  18.  
  19. rm -f $LOGFILE
RAW Paste Data
Top