Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- DIR="$( cd "$( dirname "$0" )" && pwd )"
- DATETIME="$(date +%Y-%m-%d.%H_%M_%S)"
- DIRPATH=/var/www/tools/IMIQ-AdWords-Viewer/data
- ARCHIVEPATH=/storage/archiv/IMIQ-AdWords-Viewer
- SUBDIRS="errors reports tempreports logs"
- LOGFILE=$DIR/log
- for i in $SUBDIRS; do
- find $DIRPATH/$i -type f -mtime +62 | tee $LOGFILE | xargs tar -cz -f $ARCHI +++VEPATH/IMIQ-AdWords-Viewer_$i-$DATETIME.tar.gz
- done
- while read line
- do
- echo rm -f $line
- done < $LOGFILE
- rm -f $LOGFILE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement