Schedule a Rscript crontab everyminute

前端 未结 3 1830
长情又很酷
长情又很酷 2021-01-14 05:45

For some reason my R script will not run with a crontab. I have it for every minute right now for testing, but will change it once it works.

Any ideas?



        
3条回答
  •  离开以前
    2021-01-14 06:18

    You might have a problem with the working directories in R.

    When you run the script from the terminal you might be in the directory where the files the script needs are, but when the script runs with cron it uses another directory.

    Use the setwd() function inside the R script or use absolute paths when accesing files to make sure the script works no matter where it is being used.

提交回复
热议问题