Skip to content

Commit ab0b78e

Browse files
Merge branch 'release/0.17.0'
2 parents ca03fa4 + fbfa310 commit ab0b78e

File tree

4 files changed

+296
-120
lines changed

4 files changed

+296
-120
lines changed

NEWS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
## Version 0.17.0 [2024-11-10]
2+
3+
### New Features
4+
5+
* Add option `--which=<values>` for `rsc config`, which default to
6+
`--which="rsc,rstudio,sessions"`, where `rsc` displays the RStudio
7+
Server Controller settings, `rstudio` the RStudio configuration,
8+
and `user` on the RStudio sessions storage.
9+
10+
* Add option `--which=<values>` for `rsc reset`, which default to
11+
support for `rsc reset --which="rsc"`, which resets the RStudio
12+
Server Controller settings. If `sessions`, the user's RStudio
13+
sessions folder (e.g. `~/.local/share/rstudio`) to a dated tar
14+
file, and then remove that folder. This can be used as a last
15+
resort when the RStudio Server gets stuck at "R is taking longer to
16+
start than usual" after logging in.
17+
18+
* Add environment variable `RSC_RSESSION_TIMEOUT_SUSPEND` to control
19+
whether a timed out R session should be suspended to disk. If `1`
20+
(default), it will be suspended to disk, otherwise not.
21+
22+
* Now `rsc config` reports also on total directory sizes.
23+
24+
### Bug Fixes
25+
26+
* `rsc reset` did not remove the internal `rserver.pid` and
27+
`rserver_monitor.pid` files.
28+
29+
* `rsc config` reported on file sizes with a stray trailing parenthesis.
30+
31+
132
## Version 0.16.2 [2024-08-21]
233

334
### Miscellaneous

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,20 +333,20 @@ As before, the RStudio Server is available at
333333
334334
```sh
335335
$ cd /path/to/software
336-
$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.16.2.tar.gz
337-
$ tar xf 0.16.2.tar.gz
338-
$ PATH=/path/to/softwarerstudio-server-controller-0.16.2/bin:$PATH
336+
$ curl -L -O https://github.com/UCSF-CBI/rstudio-server-controller/archive/refs/tags/0.17.0.tar.gz
337+
$ tar xf 0.17.0.tar.gz
338+
$ PATH=/path/to/softwarerstudio-server-controller-0.17.0/bin:$PATH
339339
$ export PATH
340340
$ rsc --version
341-
0.16.2
341+
0.17.0
342342
```
343343
344344
To verify that the tool can find R and the RStudio Server executables,
345345
call:
346346
347347
```sh
348348
$ rsc --version --full
349-
rsc: 0.16.2
349+
rsc: 0.17.0
350350
RStudio Server: 2023.06.2+561 (Mountain Hydrangea) for Linux [/path/to/rstudio-server/bin/rstudio-server]
351351
R: 4.3.1 (2023-06-16) -- "Shortstop Beagle" [/path/to/R/bin/R]
352352
```

bin/incl/files.sh

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,52 @@ function file_info {
4747
local file=${1:?}
4848
local -i size
4949
local timestamp
50+
local now
51+
local age
5052

5153
if [[ -f "${file}" ]]; then
5254
size=$(stat --format="%s" "${file}")
5355
timestamp=$(stat --format="%Y" "${file}")
56+
now=$(date "+%s")
57+
age=$(( (now - timestamp) / 3600 ))
58+
if [[ ${age} -lt 48 ]]; then
59+
age="${age} hours ago"
60+
else
61+
age="$((age / 24)) days ago"
62+
fi
5463
timestamp=$(date -d "@${timestamp}" "+%F %T")
55-
echo "${size} bytes; ${timestamp})"
64+
echo "${size} bytes; ${timestamp} (${age})"
65+
else
66+
echo "<not available>"
67+
fi
68+
}
69+
70+
function dir_info {
71+
local dir=${1:?}
72+
local -i size
73+
local timestamp
74+
local now
75+
local age
76+
77+
if [[ -d "${dir}" ]]; then
78+
size=$(du --summarize --bytes "${dir}" | cut -f 1)
79+
timestamp=$(stat --format="%Y" "${dir}")
80+
now=$(date "+%s")
81+
age=$((now - timestamp))
82+
age=$((age / 60))
83+
if [[ ${age} -lt 120 ]]; then
84+
age="${age} minutes ago"
85+
else
86+
age=$((age / 60))
87+
if [[ ${age} -lt 48 ]]; then
88+
age="${age} hours ago"
89+
else
90+
age=$((age / 24))
91+
age="${age} days ago"
92+
fi
93+
fi
94+
timestamp=$(date -d "@${timestamp}" "+%F %T")
95+
echo "${size} bytes; ${timestamp} (${age})"
5696
else
5797
echo "<not available>"
5898
fi

0 commit comments

Comments
 (0)