Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206278

File opening error while running Rscript as cronjob

$
0
0

I am trying to run an R script as a cronjob with a conda environment. Running the script from terminal works well with following script.sh

/opt/anaconda/anaconda3/envs/{env-name}/bin/Rscript '/ABSOLUTE_PATH/script.R'>> '/ABSOLUTE_PATH/script.log' 2>&1

However, when defining the job in crontab -e as

30 14 * * * /ABSOLUTE_PATH/script.sh

Results in Error: package or namespace load failed for 'tidyverse' in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/opt/anaconda/anaconda3/envs/admenv/lib/R/library/stringi/libs/stringi.so': libicui18n.so.58: cannot open shared object file: No such file or directory Execution halted

I have tried to run it as

/opt/anaconda/anaconda3/envs/{env-name}/bin/R '/ABSOLUTE_PATH/script.R'>> '/ABSOLUTE_PATH/script.log' 2>&1

source /opt/anaconda/anaconda3/bin/activate {env-name}; Rscript '/ABSOLUTE_PATH/script.R'>> '/ABSOLUTE_PATH/script.log' 2>&1

which all resulted in the same error as a cronjob. Reinstalling packages in conda conda remove r-tidyverse; conda install -c r r-tidyverse did not help.

Used R version is 3.6.2 and Anaconda 4.8.2. How could I solve this problem?


Viewing all articles
Browse latest Browse all 206278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>