-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmirror-debian-cd.sh
executable file
·61 lines (52 loc) · 1.4 KB
/
mirror-debian-cd.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
set -ex
SCRIPT_PATH=$(readlink -f $0)
SCRIPT_NAME=$(basename $SCRIPT_PATH)
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
LOGGER_NAME=${SCRIPT_NAME%%.*}
LOGGER_FACILITY=local7.info
LOCK_FILE=${SCRIPT_DIR}/.lock.${LOGGER_NAME}
BASEDIR=$(dirname $SCRIPT_PATH)
source ${SCRIPT_DIR}/mirror-common.sh
MIRRORS_ROOT=/mnt/mirrors.os01
RSYNC_SERVER=mirror.cogentco.com
RSYNC_PATH=debian-cd
RSYNC_SOURCE=rsync://${RSYNC_SERVER}/${RSYNC_PATH}
TARGET_PATH=${MIRRORS_ROOT}/${RSYNC_PATH}/
if [ ! -d $TARGET_PATH ]; then
mkdir -p $TARGET_PATH
fi
lock
rsync --verbose \
--recursive \
--times \
--links \
--hard-links \
--stats \
--delete-after \
--exclude '*/3.*' \
--exclude '*/4.*' \
--exclude '*/5.*' \
--exclude '*/source*' \
--exclude '*/bt-*' \
--exclude '*/jigdo-*' \
--exclude '*/iso-cd/*-CD-*.iso' \
--exclude '*/iso-dvd*' \
--exclude '*/list-cd*' \
--exclude '*/list-dvd*' \
--exclude '*/list-bd*' \
--exclude '*/list-dlbd*' \
--exclude '*multi-arch*' \
--exclude '*armel*' \
--exclude '*armhf*' \
--exclude '*ia64*' \
--exclude '*kfreebsd*' \
--exclude '*mips*' \
--exclude '*mipsel*' \
--exclude '*powerpc*' \
--exclude '*s390*' \
--exclude '*sparc*' \
$RSYNC_SOURCE \
$TARGET_PATH \
| logger -i -p ${LOGGER_FACILITY} -t $LOGGER_NAME
unlock