Commit 7f4f41f1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rsync_all.sh: improve

parent 8fcdf43f
...@@ -23,7 +23,8 @@ get_rsync_path() ...@@ -23,7 +23,8 @@ get_rsync_path()
local RSYNCPATH local RSYNCPATH
if [ "$1" = "c6/branch" ] ; then if [ "$1" = "c6/branch" ] ; then
RSYNCPATH=rsync.altlinux.ru::ALTLinux RSYNCPATH=rsync.altlinux.ru::ALTLinux
elif echo "$1" | grep -q "p8/" ; then #elif echo "$1" | grep -q "p8/" ; then
elif false ; then
#RSYNCPATH=rsync://ftp.basealt.ru/pub/distributions/ALTLinux #RSYNCPATH=rsync://ftp.basealt.ru/pub/distributions/ALTLinux
RSYNCPATH=rsync://ftp.basealt.ru/ALTLinux RSYNCPATH=rsync://ftp.basealt.ru/ALTLinux
...@@ -37,7 +38,7 @@ RPMS=/var/ftp/pub/ALTLinux ...@@ -37,7 +38,7 @@ RPMS=/var/ftp/pub/ALTLinux
TIMEOUT=5000 TIMEOUT=5000
LISTARCH="i586 x86_64 x86_64-i586 noarch" LISTARCH="i586 x86_64 x86_64-i586 noarch"
DELETE="--delete-after --delete-excluded" DELETE="--delete-after --delete-excluded --max-delete=1000"
func() func()
{ {
...@@ -48,7 +49,7 @@ echo "Start sync from $RSYNCPATH/$1 to $RPMS/$1" ...@@ -48,7 +49,7 @@ echo "Start sync from $RSYNCPATH/$1 to $RPMS/$1"
# sync only if main dir is exist # sync only if main dir is exist
test -d "$RPMS/${1/\/*/}" || return 0 test -d "$RPMS/${1/\/*/}" || return 0
mkdir -p $RPMS/$1/ mkdir -p $RPMS/$1/
rsync $DELETE --fuzzy --partial --timeout=$TIMEOUT --progress --stats -vbrlt --copy-links \ rsync $DELETE --fuzzy --partial --inplace --timeout=$TIMEOUT --progress --stats -vrlt --copy-links \
--exclude "*SRPMS*" $2 \ --exclude "*SRPMS*" $2 \
$RSYNCPATH/$1/ $RPMS/$1/ $RSYNCPATH/$1/ $RPMS/$1/
RES=$? RES=$?
...@@ -65,7 +66,7 @@ sync_file() ...@@ -65,7 +66,7 @@ sync_file()
RSYNCPATH=$(get_rsync_path $1) RSYNCPATH=$(get_rsync_path $1)
echo echo
echo "Start sync from $RSYNCPATH/$1 to $RPMS/$1" echo "Start sync from $RSYNCPATH/$1 to $RPMS/$1"
rsync $DELETE --fuzzy --partial --timeout=$TIMEOUT --progress --stats -vbrlt --copy-links \ rsync $DELETE --fuzzy --partial --timeout=$TIMEOUT --progress --stats -vrlt --copy-links \
--exclude "*SRPMS*" \ --exclude "*SRPMS*" \
$RSYNCPATH/$1 $RPMS/$1 $RSYNCPATH/$1 $RPMS/$1
} }
...@@ -118,7 +119,7 @@ elif [ "$1" = "--file" ] ; then ...@@ -118,7 +119,7 @@ elif [ "$1" = "--file" ] ; then
sync_file $1 sync_file $1
exit exit
elif echo "$1" | grep -q branch ; then elif echo "$1" | grep -q branch ; then
sync_branches $1/branch sync_branches $1
exit exit
elif [ -n "$1" ] ; then elif [ -n "$1" ] ; then
sync_other $1 sync_other $1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment