From: Mariana Marasoiu Date: Fri, 17 Jun 2011 21:32:57 +0000 (+0300) Subject: added archive parser script - parses an archive from a session X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=2448d097109cc9a4835c93d72dc671e5c8a2eb0c;p=cs-p2p-next.git added archive parser script - parses an archive from a session --- diff --git a/ppf/log-parser-mysql/archive-parser b/ppf/log-parser-mysql/archive-parser new file mode 100755 index 0000000..2e8ab26 --- /dev/null +++ b/ppf/log-parser-mysql/archive-parser @@ -0,0 +1,18 @@ +#!/bin/bash + +ARCHIVE=$1 + +REMOTE_USER=root +REMOTE_HOST=p2p-next-04.grid.pub.ro +EXTRACTION_FOLDER=/home/ve/parsing_temp +LOCAL_FOLDER=. +RSYNC_OPTS=-avz + +# copy archive from remote host to a local folder +rsync $RSYNC_OPTS -e ssh --partial $REMOTE_USER@$REMOTE_HOST:$ARCHIVE $EXTRACTION_FOLDER + +# parse archive +ARCHIVE_FILE=$(basename $ARCHIVE) +libtorrent/log_parser $EXTRACTION_FOLDER/$ARCHIVE_FILE p2p_logs 1 + +rm -rf $EXTRACTION_FOLDER/$ARCHIVE_FILE