#!/bin/bash
#analyze time needed to compress data with several compression algorithms
#using file-roller and time

ARCHIVES='7z tar.bz2 tar.gz zip'
INPUT='data/'
MAXITER=5
TIMEOPTS='-a -o stat -f "%C\t%e"'

for (( I=1; $I <= $MAXITER; I++ ))
do
	for TYPE in $ARCHIVES; do
		echo "Round #$I compressing $TYPE..."
		/usr/bin/time $TIMEOPTS file-roller -a archive$I.$TYPE $INPUT
	done
	echo '---'
done

