blob: f5313435186a5b60b7c551a7eeaa8fcf10dfcd76 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/bin/bash
home="$(dirname "$(readlink -f $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,staging,pool'
[ ! -d "${target}" ] && mkdir -p "${target}"
[ ! -d "${tmp}" ] && mkdir -p "${tmp}"
[ -f "${lock}" ] && exit 1
touch "${lock}"
trap "rm -f '${lock}'" EXIT INT TERM
rsync -rtlvH --safe-links --delete-after --progress -h \
--delay-updates \
--temp-dir="${tmp}" \
--exclude='*.db.tar.gz*' \
--exclude='*.abs.tar.gz*' \
--exclude='*.files.tar.gz*' \
--exclude='*.links.tar.gz*' \
--exclude='lastsync' \
${source}/{${repos}} \
"${target}"
|