rhelmer%mozilla.com b4dfaf3710 move pushsnip from mofo repo, split into separate backup script. p=joduinn, r=rhelmer, original pushsnip written by preed b=422008
git-svn-id: svn://10.0.0.236/trunk@248186 18797224-902f-48f8-a5cc-f745e15eee43
2008-03-19 20:01:40 +00:00

31 lines
605 B
Bash
Executable File

#!/bin/bash
set -e
#set -v
LIVE_SNIPPET_DIR=/opt/aus2/incoming/3
STAGING_DIR=/opt/aus2/snippets/staging
RSYNC=/usr/bin/rsync
SED=/bin/sed
if test -z $1; then
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
exit 1
fi
newSnippetDir=`echo $1 | $SED -e 's/\///'g`
if ! test -d $STAGING_DIR/$newSnippetDir; then
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
exit 1
fi
# publish the new snippets
pushd $STAGING_DIR > /dev/null
echo Running $RSYNC -Pa $STAGING_DIR/$1/ $LIVE_SNIPPET_DIR
$RSYNC -Pa $STAGING_DIR/$1/ $LIVE_SNIPPET_DIR
popd > /dev/null
exit 0