Skip to content

Commit

Permalink
Add get.sh to download Apache logs from NFSN
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvit committed Jul 29, 2012
1 parent efece33 commit b3d2c7d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions get.sh
@@ -0,0 +1,22 @@
#!/bin/bash
mkdir -p data/apache-bz2
mkdir -p data/apache
echo RSYNC
rsync -azv 'andreyvit_livereload@ssh.phx.nearlyfreespeech.net:/home/logs/access_log.*.bz2' data/apache-bz2/
cd data/apache
for i in ../apache-bz2/*.bz2; do
dst="$(basename "$i" .bz2)"

if /usr/bin/test "$i" -nt "$dst"; then
echo BUNZIP $(basename "$i")
bunzip2 -c $i >"$dst"
fi
done
for i in access_log.*[abcdef]; do
marker="$i.DONEZ"
if /usr/bin/test "$i" -nt "$marker"; then
echo "CONCAT $i"
cat $i >>${i%?}
touch $marker
fi
done

0 comments on commit b3d2c7d

Please sign in to comment.