From: "Алексей Любимов" <avl@l14.ru>
To: ALT Linux Sisyphus discussion list <sisyphus@altlinux.ru>
Subject: Re: [sisyphus] AptRpm
Date: Mon, 12 Apr 2004 18:19:25 +0400
Message-ID: <407AA56D.4060709@l14.ru> (raw)
In-Reply-To: <20040412134300.GB26922@osdn.org.ua>
Завсегда.
Я просто в апреле недееспособен из за аллергии, так что помощи особой
оказать не могу.
Скрипты можно добавлять к себе в дом. папку. Там есть объект - файл.
Michael Shigorin пишет:
>On Mon, Apr 12, 2004 at 04:49:52PM +0400, Алексей Любимов wrote:
>
>
>>а также глянуть начавшийся порт этой темы
>>http://www.linux-os.ru/wiki/AptRpm
>>
>>
>
>О, а мож туда еще пару скриптиков добавить -- для синхронизации
>компонент с повтором до победы или max_attempts и для создания
>снапшотов сизифа?
>
>
>
>------------------------------------------------------------------------
>
>#!/bin/sh
>RSYNC_RSH=rsh
>MAXATTEMPTS=5
>TMOUT1=500
>TMOUT2=15
>SRCROOT=rsync://rsync.altlinux.ru/ALTLinux # 2003-04-15
>#SRCROOT=rsync://ibiblio.org/Linux/distributions/altlinux # 2002-12-07
>#SRCROOT=rsync://ftp.leo.org/ALTLinux # 2002-12-09
>DESTROOT=~ftp/pub/Linux/ALT
>#LIST="updates Sisyphus Mozilla OpenOffice"
>LIST="updates Sisyphus Mozilla "
>#LIST="updates"
>RSYNC=/usr/bin/rsync
>RSYNCARGS="-rltgoDuz --partial --timeout=$TMOUT1 --delete --delete-after"
>RSHOME=~/rsync
>MAINTAINER=mike@osdn.org.ua
>
>for mirror in $LIST; do
> OK=
> attempt=1
> LOG=$RSHOME/rsync-$mirror.log
> LOCK=$RSHOME/lock.$mirror
> FLAG=$DESTROOT/$mirror/__SYNCING__
> date >> $LOG
> [ -f $LOCK ] && {
> ps auxww | grep rsync | mail -s "OSDN: $mirror: lockfile exists" $MAINTAINER
> echo "Lockfile for $mirror exists, quitting" >> $LOG
> continue
> }
> trap "rm -f $LOCK; exit 1" INT
> touch $LOCK $FLAG
> while [ -z "$OK" -a $attempt -lt $MAXATTEMPTS ]; do
> $RSYNC $RSYNCARGS $* $SRCROOT/$mirror/ $DESTROOT/$mirror \
> >> $LOG 2>&1 && OK=1
> sleep $TMOUT2
> attempt=$(($attempt+1))
> done
> [ -z "$OK" ] && {
> tail $LOG | mail -s "OSDN: $mirror trouble" $MAINTAINER
> } || {
> rm -f $FLAG
> }
> rm -f $LOCK
> date >> $LOG
>done
>
>nice symlinks -dr $DESTROOT >/dev/null
>
>
>------------------------------------------------------------------------
>
>#!/bin/sh
># script by Michael Shigorin <mike@osdn.org.ua> for snapshotting
># ALT Linux Sisyphus locally; feel free to use and modify, would
># be glad to hear back about changes
>
># mirror/site-specific
>SRC="ftp.altlinux.org.ua::ALTLinux/Sisyphus/"
>BASEDIR="/var/ftp/pub/EMT/Sisyphus/"
>
># retry params
>MAXCOUNT=5
>TIMEOUT=60
>
># shouldn't need to be changed
>DATE=`date +%Y%m%d`
>LOGDIR="$BASEDIR/log/"
>LOGFILE="$LOGDIR/$DATE.log"
>DEST="$BASEDIR/.syncing/"
>
>RSYNCARGS="-av --partial --delete"
>
>RPMARGS="-qp --queryformat %{RELEASE}\n"
>TAGFILE="$DEST/files/i586/RPMS/altlinux-release-Sisyphus-alt*.noarch.rpm"
>
>unset OK
>
># init env
>mkdir -p "$BASEDIR" "$LOGDIR"
>cd "$BASEDIR"
>
># create hardlinked copy or init dir; order critical
>LAST=`ls -d1 20?????? 2>/dev/null | tail -1`
>rm -rf "$DEST"
>[ -n "$LAST" ] && cp -al "$LAST" "$DEST" || mkdir -p "$DEST"
>
># try to sync up
>for attempt in `seq 1 $MAXCOUNT`; do
> rsync $RSYNCARGS "$SRC" "$DEST" 2>&1 >> "$LOGFILE" && {
> OK="yes"
> break
> }
> sleep "$TIMEOUT"
>done
>
>[ -z "$OK" ] && exit 1
>
># get timestamp from specific package and move to it
>TIMESTAMP=`rpm $RPMARGS $TAGFILE | tail -1 | sed 's/alt//'`
>
>[ ! -d "$TIMESTAMP" ] && {
> mv "$DEST" "$TIMESTAMP"
> touch -d "$DATE" "$TIMESTAMP"
> # fix symlink
> rm -f current
> ln -s "$TIMESTAMP" current
>} || rm -rf "$DEST"
>
># that's all :)
>echo "** $TIMESTAMP sync OK" >> "$LOGFILE"
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Sisyphus mailing list
>Sisyphus@altlinux.ru
>http://lists.altlinux.ru/mailman/listinfo/sisyphus
>
>
prev parent reply other threads:[~2004-04-12 14:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-12 5:18 [sisyphus] LTSP.RU Ivan Fedorov
2004-04-12 9:21 ` [sisyphus] LTSP.RU Michael Shigorin
2004-04-12 12:49 ` Алексей Любимов
2004-04-12 13:43 ` [sisyphus] AptRpm (was: LTSP.RU) Michael Shigorin
2004-04-12 14:19 ` Алексей Любимов [this message]
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=407AA56D.4060709@l14.ru \
--to=avl@l14.ru \
--cc=sisyphus@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 Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/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 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git