Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Warsync - a tool for speeding up rsync of war files by unzipping them on the source and target and then rsyncing the diffs
#!/bin/bash
#Warsync - a tool for speeding up rsync of war files by unzipping them on the source and target and then rsyncing the diffs
echo "Usage: $0 source.war destinationserver"
CURRENTDIR=$PWD
WARFILE="$CURRENTDIR/$1"
REMOTEHOST=$2
CURRENTUSER=$USER
REMOTEHOME="/home/$CURRENTUSER"
WARFILENAME=`basename $1`
echo "source is $WARFILE target is $TARGET"
TEMPBASE="/tmp/warsync/"
TEMPDIR="$TEMPBASE/$WARFILENAME"
mkdir -p "$TEMPDIR"
cd "$TEMPDIR"
jar -xvf "$WARFILE"
ssh $REMOTEHOST "mkdir -p \"$TEMPDIR\";cd \"$TEMPDIR\";REMOTEDIR=\"$PWD\";pwd;jar -xvf \"$REMOTEHOME/$WARFILENAME\""rsync -avz --human-readable --progress --delete "$TEMPDIR" $REMOTEHOST:"$TEMPBASE"
ssh $REMOTEHOST "jar -cvf \"$WARFILENAME\" -C \"$TEMPDIR\" ./;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.