added sync.sh - rsync wrapper ..
[scripts/scripts.git] / sync.sh
1 #!/bin/sh
2
3 # sync files: SRC <-> local
4
5 # source host / user / dir
6 SRC="hdw" ; SRCUSER="hackbard" ; SRCDIR="/home/hackbard"
7 # destination dir
8 DSTDIR="/mnt/bunker/hackbard"
9 # use ssh
10 export RSYNC_RSH="ssh"
11 # rsync cmd
12 RSYNC="rsync -aovz"
13 # directories to sync
14 DIRS="docs/mosc/ docs/dvb/ docs/kernel/ docs/nagra/"
15
16 # check for local existence, continue rsync if true
17 for DIR in $DIRS; do
18         if [ -d $DIR ] ; then
19                 echo "syncing $DIR from host $SRC, directory $SRCDIR ..."
20                 $RSYNC ${SRC}:${SRCDIR}/$DIR ${DSTDIR}/$DIR
21         fi
22 done
23
24 echo "done."