Sorry for spending your time, I would like to ask something about the package of vroom in R. Turns out I'm using vroom to open multiple files. The strange thing is that when I run the script from R terminal everything works fine, but when I run the process from a crontab there is a moment, during that opening of many files, that gives me the following error:
Error in gzfile(file, "rb") : cannot open the connection
Calls: vroom ... .rlang_cli_format_fallback -> .rlang_cli_compat ->
execution halted
sh: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 24
Do you know about this? Have you ever had a problem like this with vroom?
Ok I see, I am not an expert with environments. I have several R scripts running in that bash script but also I have some bash running in that bash. I think that if I use #! /usr/bin/env the bash scripts will not work?
#!/bin/bash
#**********************************************************************************
# Gonzalo M. Diaz
# MINISTERIO DE DEFENSA - Servicio Meteorologico Nacional, Buenos Aires, 08.01.2016
#**********************************************************************************
#
###################################################################################
### RUTA DE:
##### LOS SCRIPTS DEL PROCESO DE VIC+ROUTE OPERATIVOS
path='/home/gdiaz/Documentos/VIC+route/OBS'
path_post='/home/gdiaz/Documentos/VIC+route/POST-PROCESAMIENTO'
###################################################################################
#
LOG=${path}'/LOG_VIC-route_operativo.txt'
rm ${LOG}
echo "---------------------------------------------------------------------------------------" >> $LOG 2>&1
echo "COMANDOS DE SALIDA DE LOS SCRIPTS DEL PROCESO DE SIMULACION DEL VIC Y ROUTE OPERATIVOS" >> $LOG 2>&1
echo "---------------------------------------------------------------------------------------" >> $LOG 2>&1
date >> $LOG 2>&1
echo "
" >> $LOG 2>&1
#
#
#**********************************************************************************
# Paso 01 -> De la operatividad del Modelo VIC + routeo
# Kriging sobre las observaciones de la red de estaciones del SMN
#**********************************************************************************
Rscript ${path}/01_Interpola-Kriging.R >> $LOG 2>&1
#**********************************************************************************
# Paso 02 -> De la operatividad del Modelo VIC + routeo
# Genera archivos "data" para leer por el VIC como archivos de entrada
#**********************************************************************************
Rscript ${path}/02b_Genera-data-VIC.R >> $LOG 2>&1
#**********************************************************************************
# Paso 03 -> De la operatividad del Modelo VIC + routeo
# GeneraciĆ³n del archivo de Control del modelo VIC para la corrida
#**********************************************************************************
${path}/03_Genera-control-VIC.bash >> $LOG 2>&1
I don't have much experience with bash scripts and I can't find anything about enviroments when calling RScript from whitin bash. Hopefully someone else here has experience with this.
On a side note, I think using GNU make to develop a data pipeline is a more robust solution for this use case. Here is a nice paper on the topic if you are curious.