summaryrefslogtreecommitdiff
path: root/sync_centos.sh
blob: f42c76a4b08b902952a3d9e17c7fa6791e1ded4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
if [ -f /var/lock/subsys/rsync_updates ]; then
    echo "Updates via rsync already running."
    exit 0
fi
# i386
if [ -d /var/www/html/Centos/6.5 ] ; then
    touch /var/lock/subsys/rsync_updates
    for a in x86_64; do
      for i in os updates extras centosplus contrib; do
        rsync  -avSHP --delete --exclude "local*" --exclude "isos" centos.intergenia.de::centos-linux/6.5/$i/$a/ /var/www/html/Centos/6.5/$i/$a/
      done
    done
    /bin/rm -f /var/lock/subsys/rsync_updates
else
    echo "Target directory /var/www/html/Centos/6.5 not present."
fi