echo
+echo Options
+echo go - does the sync for real
+echo check - checks for changed files
+
+echo
+
echo
echo For a better explanation of the output flags please check --itemize-changes at rsync man page
echo
RSYNC_SSH="--rsh=ssh $SSH_OPTS"
fi
- echo "Syncing $FROM -> $TO"
- rsync --include=*/ --include=**/maven-metadata.xml* --exclude=* --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt $RSYNC_OPTS -Lrtivz "$RSYNC_SSH" $FROM $BASEDIR/$TO
- rsync --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt --ignore-existing $RSYNC_OPTS -Lrtivz "$RSYNC_SSH" $FROM $BASEDIR/$TO
-
# check for changed files
- rsync -n --exclude=**/maven-metadata.xml* --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt --existing $RSYNC_OPTS -Lrtivzc "$RSYNC_SSH" $FROM $BASEDIR/$TO >> $CHANGED_LOG
+ if [ "$1" == "check" ]; then
-done
+ rsync -n --exclude=**/maven-metadata.xml* --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt --existing $RSYNC_OPTS -Lrtivzc "$RSYNC_SSH" $FROM $BASEDIR/$TO >> $CHANGED_LOG
+
+ else
-echo "*******************************************************************************"
-echo "******************************* CHANGED FILES *******************************"
-echo "*******************************************************************************"
-cat $CHANGED_LOG
-echo "*******************************************************************************"
-echo "*******************************************************************************"
-echo "*******************************************************************************"
+ echo "Syncing $FROM -> $TO"
+ rsync --include=*/ --include=**/maven-metadata.xml* --exclude=* --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt $RSYNC_OPTS -Lrtivz "$RSYNC_SSH" $FROM $BASEDIR/$TO
+ rsync --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt --ignore-existing $RSYNC_OPTS -Lrtivz "$RSYNC_SSH" $FROM $BASEDIR/$TO
+ fi
+
+done
+
+if [ "$1" == "check" ]; then
+ echo "*******************************************************************************"
+ echo "******************************* CHANGED FILES *******************************"
+ echo "*******************************************************************************"
+ cat $CHANGED_LOG
+ echo "*******************************************************************************"
+ echo "*******************************************************************************"
+ echo "*******************************************************************************"
+fi