From: hackbard Date: Sun, 4 Jan 2004 20:43:16 +0000 (+0000) Subject: added sync.sh - rsync wrapper .. X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c5ea12662d55c861e1522f7f3f92e18ab45f8b9;p=scripts%2Fscripts.git added sync.sh - rsync wrapper .. --- diff --git a/sync.sh b/sync.sh new file mode 100755 index 0000000..7df0396 --- /dev/null +++ b/sync.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# sync files: SRC <-> local + +# source host / user / dir +SRC="hdw" ; SRCUSER="hackbard" ; SRCDIR="/home/hackbard" +# destination dir +DSTDIR="/mnt/bunker/hackbard" +# use ssh +export RSYNC_RSH="ssh" +# rsync cmd +RSYNC="rsync -aovz" +# directories to sync +DIRS="docs/mosc/ docs/dvb/ docs/kernel/ docs/nagra/" + +# check for local existence, continue rsync if true +for DIR in $DIRS; do + if [ -d $DIR ] ; then + echo "syncing $DIR from host $SRC, directory $SRCDIR ..." + $RSYNC ${SRC}:${SRCDIR}/$DIR ${DSTDIR}/$DIR + fi +done + +echo "done."