mirror of https://github.com/balkian/gists
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
325 B
Bash
15 lines
325 B
Bash
#!/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 |