From: Yura Kalinichenko <yuk@iceb.vinnitsa.com>
To: AltLinux Community Maillist <community@altlinux.ru>
Subject: Re: [Comm] задачка для начинающего
Date: 12 Aug 2004 19:35:37 +0300
Message-ID: <1092328537.4705.7.camel@iceb> (raw)
In-Reply-To: <411B85AF.50700@list.ru>
В Чтв, 12.08.2004, в 17:58, Jury Levykin написал:
> Eugene A. Suchkov пишет:
>
> > Oleg Pan пишет:
> >
> >> Hello community,
> >>
> >> есть папка
> >> в ней около 20000 файлов
> >>
> >> есть ли какое нибудь средство для архивации их по дате
> >>
> >> то-есть получить архивы:
> >> 01-08-04.tar.gz
> >> 02-08-04.tar.gz
> >> 03-08-04.tar.gz
Если это просто файлы - tar там лишний. Достаточно gz.
> >> ...
> >
> >
> > есть
> > man bash
>
> а можно поконкретней, что посмотреть в bash ?
Ну к примеру можно использовать вот такой скрипт:
---------------cut on-------------------------------
#!/bin/sh
#
usage () {
echo -e "\nUsage:\n\n\t$0 directory\n"
}
compress_file () {
local suffix
echo $1
suffix=`ls --full-time "$1" | awk '{ print $6 }'`
gzip -S ".${suffix}.gz" $1
return $?
}
if [ $# -eq 0 ]; then
usage
exit 0
fi
for fn in `find $1 -type f` ; do
compress_file $fn
if [ $? -ne 0 ]; then
echo "ОШИБКА."
break
fi
done
echo "Bce!"
-----------------cut off------------------------------
А уж что там есть что - это действительно man bash.
--
Yura Kalinichenko
next prev parent reply other threads:[~2004-08-12 16:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-12 12:40 Oleg Pan
2004-08-12 12:43 ` [Comm] çàäà÷êà äëÿ íà÷èíàþùåãî Alexander Volkov
2004-08-12 13:49 ` [Comm] задачка для начинающего Eugene A. Suchkov
2004-08-12 14:58 ` Jury Levykin
2004-08-12 15:01 ` [Comm] " Michael Shigorin
2004-08-12 16:35 ` Yura Kalinichenko [this message]
2004-08-12 16:39 ` Michael Shigorin
2004-08-13 8:09 ` Oleg Pan
2004-08-13 8:19 ` Artem K. Jouravsky
2004-08-13 12:41 ` Re[2]: " Oleg Pan
2004-08-13 13:04 ` Artem K. Jouravsky
2004-08-13 13:39 ` Re[2]: " Oleg Pan
2004-08-13 13:49 ` Artem K. Jouravsky
2004-08-12 17:37 ` [Comm] " Artem K. Jouravsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1092328537.4705.7.camel@iceb \
--to=yuk@iceb.vinnitsa.com \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git