#!/bin/bash
MONTH="$((`date +%m`-1))"
YEAR=$(date +"%Y")
cd /var/www/
for f in $(ls /var/www | grep web); do
cd /var/www/$f/log
if [ -a $YEAR ];
then
cd $YEAR
if [ -a 0$MONTH ];
then
tar -zcvf 0$MONTH.tar.gz 0$MONTH
rm -rf /var/www/$f/log/$YEAR/0$MONTH
fi
fi
done
Label: apache, bash
diposting oleh Unknown #
13:09
Posting Komentar