bluegreen-labs / ecmwfr

Interface to the public ECMWF API Web Services
https://bluegreen-labs.github.io/ecmwfr/
Other
106 stars 30 forks source link

Unlock keyring in (headless) scripts #121

Closed khufkens closed 1 year ago

khufkens commented 1 year ago

To start a script as a batch job you will need to pass the keyring password and unlock the keyring for this session. In the past this would trigger an interactive prompt but for 'reasons' this seems not to work anymore. This is a workaround.

#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)

library("ecwmfr")

# set file based keyring and unlock with argument
options(keyring_backend="file")
keyring::keyring_unlock("appeears", args[1])