added archive parser script - parses an archive from a session
authorMariana Marasoiu <mariana.marasoiu@gmail.com>
Fri, 17 Jun 2011 21:32:57 +0000 (00:32 +0300)
committerroot p2p-next-02 <root@p2p-next-02.grid.pub.ro>
Fri, 17 Jun 2011 21:33:25 +0000 (00:33 +0300)
ppf/log-parser-mysql/archive-parser [new file with mode: 0755]

diff --git a/ppf/log-parser-mysql/archive-parser b/ppf/log-parser-mysql/archive-parser
new file mode 100755 (executable)
index 0000000..2e8ab26
--- /dev/null
@@ -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