From 101c0be26573b6cc20a8542d378592fd0eec2ba5 Mon Sep 17 00:00:00 2001 From: dumpfmprod Date: Wed, 14 May 2014 12:02:39 -0400 Subject: scripts to fix redis when it crashes --- scripts/sort_faves.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/sort_faves.sh (limited to 'scripts/sort_faves.sh') diff --git a/scripts/sort_faves.sh b/scripts/sort_faves.sh new file mode 100755 index 0000000..eb28a39 --- /dev/null +++ b/scripts/sort_faves.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if [ ! -n "$1" ] +then + echo "Usage: `basename $0` fav_scores.csv" + exit +fi + +mkdir -p faves + +echo "Get the top 50 faves for the Hall of Fame" +sort -t, -k3,3 -rn $1 | head -50 > faves/hall.csv + +echo "Group faves by user for popular pages, total fave scores" +sort -t, -k1,1 -r -k3,3 -n faves/counts_sorted.csv > faves/by_user.csv + +echo "Group faves by date for daily tallies" +sort -t, -k4,4 -r -k3,3 -n faves/counts_sorted.csv > faves/by_date.csv + + -- cgit v1.2.3-70-g09d2