diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-06-25 21:52:38 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-06-25 21:52:38 +0200 |
commit | f16a290a06d404722d53f6b38e567e340f9d7387 (patch) | |
tree | b128d46774f33d1fd785873e3bc709a9272f2992 /syncrepo | |
parent | 7824ead91e5b27474bdedde411b3db7c4c1a1ace (diff) | |
download | repo-tools-f16a290a06d404722d53f6b38e567e340f9d7387.tar.gz repo-tools-f16a290a06d404722d53f6b38e567e340f9d7387.tar.xz |
make sync more atomic
Diffstat (limited to 'syncrepo')
-rwxr-xr-x | syncrepo | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -2,24 +2,21 @@ home="$(dirname "${0}")" target="${home}/repo" +tmp="${home}/tmp" lock='/tmp/mirrorsync.lck' source='-e ssh gerolde.archlinux.org:/srv/ftp' repos='core,extra,testing,community,community-testing' -[ ! -d "${target}" ] && exit 1 +[ ! -d "${target}" ] && mkdir -p "${target}" +[ ! -d "${tmp}" ] && mkdir -p "${tmp}" [ -f "${lock}" ] && exit 1 touch "${lock}" trap "rm -f '${lock}'" EXIT INT TERM -rsync -rptlv --safe-links --delete --progress -h \ - --include='*/' \ - --include='*.db.tar.gz' \ - --exclude='*' \ - ${source}/{${repos}} \ - "${target}" - -rsync -rptlv --safe-links --delete --progress -h \ - --exclude='*.db.tar.gz*' \ +rsync -rtlvH --safe-links --delete-after --progress -h \ + --partial \ + --partial-dir="${tmp}" \ + --delay-updates \ --exclude='*.abs.tar.gz*' \ --exclude='*.files.tar.gz*' \ --exclude='*.links.tar.gz*' \ |