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 1/2] --- 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 From 0b2bff42ba422c022c293b59a6a9d43c0e23e5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20S=C3=A1nchez?= Date: Mon, 17 Dec 2012 21:09:31 +0000 Subject: [PATCH 2/2] --- example.sh => tar-and-scp.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename example.sh => tar-and-scp.sh (100%) diff --git a/example.sh b/tar-and-scp.sh similarity index 100% rename from example.sh rename to tar-and-scp.sh