1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-22 01:32:29 +00:00
gists/example.sh

15 lines
325 B
Bash
Raw Normal View History

2012-12-17 21:07:34 +00:00
#!/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