We have an RStudio server installed on Linux. We have many RStudio users, and their RStudio related directories are all in their respective home directories. However we have limited space in the home filesystem, and hence couldn't hold too much RStudio related directories, for example:
R
.local ==> I noticed that .local could be very big if the user is running big R programs.
etc.
I want to configure R server or RStudio server, so that the these directories could be redirected to a different filesystem where there is enough space.
I appreciate if you could guide me through the steps of reconfiguring.
Thanks for the reply. I followed the instruction in the document, set XDG_DATA_HOME in /etc/rstudio/env-vars (the file was not even existent before I created this time) as follows:
[root@ ~]# cat /etc/rstudio/env-vars
# Store user data on mounted external storage
XDG_DATA_HOME=/data/$USER
[root@ ~]#
And restarted rstudio. However, the session directory is still in ~/.local/share/rstudio/, not moved the new location set in env-vars. I wonder if I miss anything ?
P.S. we use community version RStudio 1.4.1101 on Redhat 7.
[root@ ~]# rstudio-server version
1.4.1106 (Tiger Daylily) for CentOS 7
[root@ ~]#
Did you restart RStudio Server and created a new session? Does the directory /data/$USER exist for the user in question? What is the value of the environment variable XDG_DATA_HOME?
I just tested this with the rocker/rstudio Docker container
yes, the directory /data/$USER for each user (including myself).
We don't use docker, and hence we directly installed RStudio on Linux. As for XDG_DATA_HOME, how to check that, in which specific configuration file ? P.S., it's a single RStudio server, and we don't have a cluster.
yes each user has it's individual /data/$USER directory, i.e. user id bob has /data/bob/, user id tom has /data/tom/, these directories are not shared, rather they are owned by each individual users.
I did restarted Rstudio server after changes.
For XDG_DATA_HOME, I got this from R console:
Sys.getenv("XDG_DATA_HOME").
Error: unexpected symbol in "Sys.getenv("XDG_DATA_HOME")."
The problem seems to be your RStudio Server version. According to the current RStudio Release Notes - RStudio support for /etc/rstudio/env-vars was added in the most recent version 1.4.1717. So it is probably best if you upgrade your installation.