From ed3b93fb6f07961af61e753220b58cbc4b779a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20S=C3=A1nchez?= Date: Mon, 17 Dec 2012 13:07:34 -0800 Subject: [PATCH] --- example.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 example.sh diff --git a/example.sh b/example.sh new file mode 100644 index 0000000..35cf1b2 --- /dev/null +++ b/example.sh @@ -0,0 +1,15 @@ +#!/bin/bash +tosend="" +for i in *.log; do + dir=$(echo $i | awk '{split($1,a,"_"); print a[1]}'); + if [ ! -d $dir ]; then + mkdir $dir; + fi; + mv $i $dir; + tosend="$tosend\n$dir" +done +for i in $(echo -e $tosend | uniq);do + echo Compressing $i + tar -zcvf $i.tar.gz $i + scp $i.tar.gz user@server +done \ No newline at end of file