-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeep_hosts_sync_with_rsync.sh
executable file
·68 lines (51 loc) · 2.13 KB
/
keep_hosts_sync_with_rsync.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
61
62
63
64
65
66
67
#!/bin/bash
LOCAL_ESCO_HOME='/home/esco'
REMOTE_ESCO_HOME='/home/esco'
RSYNC=/usr/bin/rsync
RSYNC_OPT='-arv'
RSYNC_SYMLINKS_OPT='-L'
DEST='epervier'
if [ -d "${LOCAL_ESCO_HOME}" ]; then
${RSYNC} ${RSYNC_OPT} ${LOCAL_ESCO_HOME}/*.sh ${DEST}:${REMOTE_ESCO_HOME}/ >/dev/null
RES=$?
if [ ${RES} -ne 0 ]; then
echo "Copy of shell scripts to ${DEST} failed with ${RES}";
exit ${RES}
fi
${RSYNC} ${RSYNC_OPT} ${RSYNC_SYMLINKS_OPT} ${LOCAL_ESCO_HOME}/conf-cas-saml-prod ${DEST}:${REMOTE_ESCO_HOME}/ >/dev/null
RES=$?
if [ ! $RES -eq 0 ]; then
echo "Copy of ${LOCAL_ESCO_HOME}/conf-cas-saml-prod scripts to ${DEST} failed with ${RES}";
exit $RES
fi
${RSYNC} ${RSYNC_OPT} ${RSYNC_SYMLINKS_OPT} ${LOCAL_ESCO_HOME}/conf-cas-saml-test ${DEST}:${REMOTE_ESCO_HOME}/ >/dev/null
RES=$?
if [ ! $RES -eq 0 ]; then
echo "Copy of ${LOCAL_ESCO_HOME}/conf-cas-saml-test scripts to ${DEST} failed with ${RES}";
exit $RES
fi
${RSYNC} ${RSYNC_OPT} ${RSYNC_SYMLINKS_OPT} ${LOCAL_ESCO_HOME}/CAS-production-version/custom ${DEST}:${REMOTE_ESCO_HOME}/CAS-production-version/ >/dev/null
RES=$?
if [ ! $RES -eq 0 ]; then
echo "Copy of ${LOCAL_ESCO_HOME}/CAS-production-version/custom scripts to ${DEST} failed with ${RES}";
exit $RES
fi
${RSYNC} ${RSYNC_OPT} ${RSYNC_SYMLINKS_OPT} ${LOCAL_ESCO_HOME}/CAS-production-version/resources ${DEST}:${REMOTE_ESCO_HOME}/CAS-production-version/ >/dev/null
RES=$?
if [ ! $RES -eq 0 ]; then
echo "Copy of ${LOCAL_ESCO_HOME}/CAS-production-version/resources scripts to ${DEST} failed with ${RES}";
exit $RES
fi
${RSYNC} ${RSYNC_OPT} ${RSYNC_SYMLINKS_OPT} ${LOCAL_ESCO_HOME}/CAS-test-version ${DEST}:${REMOTE_ESCO_HOME}/ >/dev/null
RES=$?
if [ ! $RES -eq 0 ]; then
echo "Copy of ${LOCAL_ESCO_HOME}/CAS-test-version scripts to ${DEST} failed with ${RES}";
exit $RES
fi
${RSYNC} ${RSYNC_OPT} ${RSYNC_SYMLINKS_OPT} --exclude 'shibboleth-idp/logs/' /opt/shibboleth-idp ${DEST}:/opt/ >/dev/null
RES=$?
if [ ! $RES -eq 0 ]; then
echo "Copy of /opt/shibboleth-idp to ${DEST} failed with ${RES}";
exit $RES
fi
fi