find . -ctime -60 -maxdepth 1 -type f | while IFS= read x
do
gzip -9 "$x" # compress it
D=${x%%.csv}
D=${D/-*/} # remove suffix and everything after the -
mkdir -p "$D" # create dest sub folder
mv $x.gz "$D" # move it
done
Главная
- Просмотров: 3849