Пишу лабу на баше, надо заархивировать файлы подходящие по маскам(название, пользователь, группа, размер). Получил такой список:
kubarev_ai kubarev_ai /home/kubarev_ai/.kde/share/apps/amarok/my.cnf
kubarev_ai kubarev_ai /home/kubarev_ai/.kde/share/apps/amarok/mysqle
kubarev_ai kubarev_ai /home/kubarev_ai/.kde/share/apps/amarok/mysqle/mysql
kubarev_ai kubarev_ai /home/kubarev_ai/.local/share/akonadi/db_data/mysql-bin.000001
kubarev_ai kubarev_ai /home/kubarev_ai/.local/share/akonadi/db_data/mysql-bin.index
kubarev_ai kubarev_ai /home/kubarev_ai/.local/share/akonadi/db_data/mysql.err
kubarev_ai kubarev_ai /home/kubarev_ai/.local/share/akonadi/db_data/mysql.slow
kubarev_ai kubarev_ai /home/kubarev_ai/.local/share/akonadi/mysql.conf
kubarev_ai kubarev_ai /home/kubarev_ai/.openoffice.org/3/user/autotext/mytexts.bau
kubarev_ai kubarev_ai /home/kubarev_ai/.opera/icons/my.mail.ru.idx
#!/bin/bash
count=$#
for ((i=1; i <= $count ; i=$i+2))
do
case $1 in
"-r" )
rules=$2
;;
"-t" )
type=$2
;;
"-log" )
log=$2
;;
*)
path=$1
;;
esac
shift
shift
done
name=""
while read i; do
name=$( echo "$i" | awk '{print $1}' )
size=$( echo "$i" | awk '{print $2}' )
user=$( echo "$i" | awk '{print $3}' )
grp=$( echo "$i" | awk '{print $4}' )
size='-'$size'c'
find "$path" -name "$name" -size "$size" -ls | awk '{print $11}' | xargs tar -r -f test.tar -g
done <$rules