From caa6945b7ed72ca03cd3aaf8d2109afb3bcd2f3c Mon Sep 17 00:00:00 2001 From: Valdos Sine Date: Wed, 15 Aug 2012 00:24:00 +0400 Subject: [PATCH] Add script to obtain torrents download size --- massps.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 massps.sh diff --git a/massps.sh b/massps.sh new file mode 100755 index 0000000..66daf18 --- /dev/null +++ b/massps.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# For NNM-Club Uploaders +# Copyright (c) 2012 Valdos Sine +# +# Usage: +# +# ./massps.sh +# +# Install pyrocore by executing: +# +# sudo easy_install pyrocore + +TMPDIR=`mktemp -d` + +SIZE=0 +COUNT=0 + +# Find all torrents +find . -name *torrent > $TMPDIR/allfilez.txt + +while read line +do + COUNT=$(($COUNT + 1)) + echo "$COUNT" + INCREMENT=`lstor "$line" -qo __size__` + SIZE=$(($SIZE + $INCREMENT)) +done < $TMPDIR/allfilez.txt + +echo "$SIZE bytes -> $(($SIZE / 1024)) KB -> $(($SIZE / 1024 / 1024 )) MB -> $(($SIZE / 1024 / 1024 / 1024)) GB." + +rm -r $TMPDIR