Skip to content

Instantly share code, notes, and snippets.

@kowey
Last active August 29, 2015 14:15
Show Gist options
  • Save kowey/30cff61c8f53e52e8213 to your computer and use it in GitHub Desktop.
Save kowey/30cff61c8f53e52e8213 to your computer and use it in GitHub Desktop.
#!/bin/bash
# copy and archive latest reports/scores from the cluster
# filenames are {corpus}-{date}__{machine}__{logword}, eg
#
# scores-TRAINING-2015-02-05__eric-laptop__scikit.txt
# scores-TRAINING-2015-02-07__eric-laptop__ptb-sent.txt
# scores-TRAINING-2015-02-09__cluster__hello.txt
# scores-TRAINING-2015-02-12__cluster__parallel.txt
# scores-TRAINING-2015-02-16__cluster__intra-mst.txt
# scores-TRAINING-2015-02-16__eric-laptop__parallel.txt
# scores-TRAINING-2015-02-17__cluster__skperceptron.txt
# cwd-proofing
ZERO_DIR=$(dirname "$0")
pushd "$ZERO_DIR" > /dev/null
SCRIPT_DIR=$PWD
popd > /dev/null
cd "$SCRIPT_DIR"
# force user to give us a log word
if [ $# -ne 2 ]; then
echo >&2 "Usage: $0 double|training log-word"
exit 1
fi
if [ "$1" == "double" ]; then
CORPUS=RSTtrees-WSJ-double-1.0
else
CORPUS=TRAINING
fi
LOGWORD=$2
# copy from the cluster (preserve hardlinks too, eh?)
TODAY=$(date +%Y-%m-%d)
SUFFIX=${CORPUS}-${TODAY}__cluster__${LOGWORD}
rsync -avH cluster:irit-rst-dt/TMP/latest/eval-current/reports-"$CORPUS" reports/"reports-${SUFFIX}"
cp "reports/reports-${SUFFIX}"/scores.txt "scores/scores-${SUFFIX}".txt
cd reports
tar cjvf "reports-${SUFFIX}.tar.bz2" "reports-${SUFFIX}"
cd ..
tar cjvf "all-scores-${TODAY}.tar.bz2" scores
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment