summaryrefslogtreecommitdiffstats
path: root/syncrepo
blob: 1803b8c122776493aaf9660c3ff3e66a9353eb92 (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
26
27
28
29
#!/bin/bash

home="$(dirname "${0}")"
target="${home}/repo"
lock='/tmp/mirrorsync.lck'
source='-e ssh gerolde.archlinux.org:/srv/ftp'
repos='core,extra,testing,community,community-testing'

[ ! -d "${target}" ] && exit 1
[ -f "${lock}" ] && exit 1
touch "${lock}"

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*' \
	--exclude='*.abs.tar.gz*' \
	--exclude='*.files.tar.gz*' \
	--exclude='*.links.tar.gz*' \
	--exclude='lastsync' \
	${source}/{${repos}} \
	"${target}"

rm -f "${lock}"