Skip to content

Commit

Permalink
migrate to rds "flat files"
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Sep 13, 2013
1 parent f71adb1 commit b1f97b1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/migrate2ff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

## Migrates old file-based store to new RDS flat-file structure
##
## This scripts reads *.json files from data/userfiles and
## stores them in the expected locations for RDS flat files,
## the new default RCS engine

if [ ! -e "data/userfiles" ]; then
echo '' >&2
echo " $0 must be run from the RCloud root" >&2
echo '' >&2
exit 1
fi

for f in data/userfiles/*.json; do
u=`echo $f | sed 's:data/userfiles/\(.*\)\.json:\\1:'`
mkdir -p data/rcs/$u/system
echo "saveRDS(readLines('$f'), 'data/rcs/$u/system/config.json')" | R --vanilla --slave
done

0 comments on commit b1f97b1

Please sign in to comment.