-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f71adb1
commit b1f97b1
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |