ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Sergei <serpiph@pochtamt.ru>
To: mandrake-russian@altlinux.ru
Subject: Re: [mdk-re] Spring 2001 ISO
Date: Wed Apr  4 02:32:15 2001
Message-ID: <01040402434500.11074@pif.b5.mephi.ru> (raw)
In-Reply-To: <20010404000711.70328c88.is13@inbox.ru>

[-- Attachment #1: Type: text/plain, Size: 509 bytes --]

 3 Апрель 2001 22:07 Вы написали:
> Hi!
> On Mon, 02 Apr 2001 16:34:34 +0700
>
> hokum <hokum@mail.ru> wrote:
> > Подскажите пожалуйста, можно ли где-нибудь достать iso дисков нового
> > дистрибутива. Rsync постоянно обрывает, чем ещё можно скачать такую уйму
> > файлов не знаю. Поиожите, кто чем может  :-)
>
> rsync-ом и можно. А если обрывается, то тут уже публиковали несколько
> вариантов скриптов для скачивания при постоянных обрывах связи.
Один из вариантов скриптов.
-- 
С уважением, Епифанов Сергей

[-- Attachment #2: getRE --]
[-- Type: text/plain, Size: 2310 bytes --]

#!/usr/bin/perl
=head1
 4.03.2001. Версия 1.00
29.03.2001. Версия 2.00b
    Изменены оформление и режим запуска rsync.
31.03.2001. Версия 2.01
    Исправлено:
    1. баг с выходом из программы getr
    2. баг запуска rsync и проверкой прерывания программы rsync.
=cut 


#Общее число попыток (0 - неограничено)
$MAX_TRIES=20;
#Число повторов скачивания одного и того же файла
$MAX_1_TRIES=5;
#Текущая попытка
$cur_try=0;
$cur_1_try=1;
#Сайт для скачивания - пример
$DownSite="rsync://ftp.altlinux.ru/MandrakeRE/Spring2001";
#Каталог для скачивания - пример
$DownDir="/var/ftp/pub/Sisyphus";

#Специальные флаги - НЕ ТРОГАТЬ
$RETVAL=1;
$WHOHANG=1;

#Пользуйтесь как хотите

print "Программа скачивания через rsync с несколькими попытками и повторами.\n";
print "Написана Епифановым Сергеем, МИФИ. Версия 2.01 от 31.03.2001\n\n";
print "Запуск:\n";
print "     getRE сайт каталог_сохранения [число_попыток [число_повторов]]\n\n";
if (defined (@ARGV))
{
    $DownSite=$ARGV[0];
    if (defined ($ARGV[1]))
    {
	$DownDir=$ARGV[1];	
	print $DownDir,"\n";
        if (defined $ARGV[2])
	{
	    $MAX_TRIES=$ARGV[2];
	    if (defined $ARGV[3])
	    {
		$MAX_1_TRIES=$ARGV[3];
	    }
	}
    }
    else
    {
        print "Недостаточно параметров - нет каталога!\n";
        exit;
    }
}
else
{
    exit;
}
#Основной цикл скачивания

while ($RETVAL)
{
#Проверка числа попыток
	$cur_try++;
	if ($cur_try>$MAX_TRIES && $MAXTRIES>0)
	{
	    print "Не хватает попыток ($MAX_TRIES) для полного скачивания, выхожу.\n";
	    exit;
	}
	print "Попытка номер $cur_try\n" if $cur_1_try==1;
	print "Повтор $cur_1_try попытки $cur_try\n" if $cur_1_try>1;
#Запуск скачивания
	$OldMSG=$NewMSG;
	$NewMSG="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
	print $DownSite," - ",$DownDir,"\n";
	$pid=open (OUTINFO,"rsync -avP --timeout=500 --delete-after '${DownSite}' '${DownDir}' |");
	if ($pid<1)
	{
	    $NewMGS=$OldMSG;
	    goto skip;
	}
	while ($line=<OUTINFO>)
	{
	    $NewMSG=$line;
	    print $line;
	}
	$res=waitpid ($pid,0);
	$ExitStatus=$?;
	close (OUTINFO);
	if (!$ExitStatus)
	{
	    print "Все скачано!\n";
	    exit;
	}
skip:
	if ($NewMSG eq $OldMSG)
	{
	    $cur_try--;
	    $cur_1_try++;
	    if ($cur_1_try>$MAX_1_TRIES)
	    {
		print "Исчерпан лимит повторов ($MAX_1_TRIES)\n";
		exit;
	    }
	}
	else
	{
	    $cur_1_try=1;
	}
}

  reply	other threads:[~2001-04-04  2:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-03 13:11 ` cornet
2001-04-03 22:01 ` Igor Solovyov
2001-04-04  2:32   ` Sergei [this message]
2001-04-04  2:48     ` Sergei

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=01040402434500.11074@pif.b5.mephi.ru \
    --to=serpiph@pochtamt.ru \
    --cc=mandrake-russian@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