Permalink
Browse files

Added diffing ability to sync scripts.

  • Loading branch information...
1 parent 19136a7 commit 53f9f54fe161890a7dde56939a2067cd0abef08b @chachi chachi committed Jan 27, 2010
Showing with 18 additions and 7 deletions.
  1. +10 −6 frames/sync
  2. +8 −1 tables/sync
View
16 frames/sync
@@ -17,11 +17,11 @@ if [ "$1" = "" ]; then
exit 1
fi
-if [ "$REMOTE_FOLDER" = "" ]; then
- echo "No remote folder specified"
- echo $USAGE
- exit 1
-fi
+# if [ "$REMOTE_FOLDER" = "" ]; then
+# echo "No remote folder specified"
+# echo $USAGE
+# exit 1
+# fi
echo "Type username for RoboCup server, followed by [ENTER]"
read username
@@ -32,7 +32,7 @@ FRAMES_DIR=frames
SYNC_UP="$RSYNC $RSYNC_OPTS $REMOTE_FOLDER $SERVER/$ROBOCUP_DIR/$FRAMES_DIR"
SYNC_DOWN="$RSYNC $RSYNC_OPTS $SERVER/$ROBOCUP_DIR/$FRAMES_DIR/$REMOTE_FOLDER/* ./$FRAMES_DIR/$REMOTE_FOLDER"
-
+DIFF="$RSYNC $RSYNC_OPTS -n ./* $SERVER/$ROBOCUP_DIR/$TABLES_DIR/"
if [ "$UP_OR_DOWN" = "up" ]; then
@@ -47,6 +47,10 @@ elif [ "$UP_OR_DOWN" = "down" ]; then
cd ../
$SYNC_DOWN
+elif [ "$UP_OR_DOWN"="diff" ]; then
+ echo "Getting diff"
+ echo $DIFF
+ $DIFF
else
echo "Invalid parameters"
echo $USAGE
View
9 tables/sync
@@ -23,11 +23,12 @@ ROBOCUP_DIR=/mnt/research/robocup
TABLES_DIR=tables
DEST=.
EXCLUDE_SYNC=--exclude=sync*
-EXCLUDE_GIT=--exclude=tables.git*
+EXCLUDE_GIT="--exclude=tables.git* --exclude=.git*"
SYNC_UP="$RSYNC $RSYNC_OPTS $EXCLUDE_SYNC $EXCLUDE_GIT $DEST/* $SERVER/$ROBOCUP_DIR/$TABLES_DIR"
SYNC_DOWN="$RSYNC $RSYNC_OPTS $EXCLUDE_SYNC $EXCLUDE_GIT $SERVER/$ROBOCUP_DIR/$TABLES_DIR/* $DEST"
+DIFF="$RSYNC $RSYNC_OPTS -n $EXCLUDE_SYNC $EXCLUDE_GIT $DEST $SERVER/$ROBOCUP_DIR/$TABLES_DIR/"
if [ "$UP_OR_DOWN" = "up" ]; then
@@ -40,6 +41,12 @@ elif [ "$UP_OR_DOWN" = "down" ]; then
echo "Syncing FROM $SERVER/$ROBOCUP_DIR/$TABLES_DIR TO `pwd` "
echo $SYNC_DOWN
$SYNC_DOWN
+
+elif [ "$UP_OR_DOWN"="diff" ]; then
+ echo "Getting diff"
+ echo $DIFF
+ $DIFF
+
else
echo "Invalid parameters"
echo $USAGE

0 comments on commit 53f9f54

Please sign in to comment.