Skip to content
This repository
Browse code

migrate to rds "flat files"

  • Loading branch information...
commit b1f97b1070546fbb01f785d18c7b73abd574d746 1 parent f71adb1
Gordon Woodhull gordonwoodhull authored

Showing 1 changed file with 20 additions and 0 deletions. Show diff stats Hide diff stats

  1. +20 0 scripts/migrate2ff.sh
20 scripts/migrate2ff.sh
... ... @@ -0,0 +1,20 @@
  1 +#!/bin/sh
  2 +
  3 +## Migrates old file-based store to new RDS flat-file structure
  4 +##
  5 +## This scripts reads *.json files from data/userfiles and
  6 +## stores them in the expected locations for RDS flat files,
  7 +## the new default RCS engine
  8 +
  9 +if [ ! -e "data/userfiles" ]; then
  10 + echo '' >&2
  11 + echo " $0 must be run from the RCloud root" >&2
  12 + echo '' >&2
  13 + exit 1
  14 +fi
  15 +
  16 +for f in data/userfiles/*.json; do
  17 + u=`echo $f | sed 's:data/userfiles/\(.*\)\.json:\\1:'`
  18 + mkdir -p data/rcs/$u/system
  19 + echo "saveRDS(readLines('$f'), 'data/rcs/$u/system/config.json')" | R --vanilla --slave
  20 +done

0 comments on commit b1f97b1

Please sign in to comment.
Something went wrong with that request. Please try again.