How to run an R script in crontab

前端 未结 3 1324
-上瘾入骨i
-上瘾入骨i 2021-01-15 07:02

Using crontab -e I\'ve tried:

* * * * *  Rscript /home/.../file.r
* * * * * /usr/lib/R/bin/Rscript /home/.../file.r
* * * * * /usr/bin/Rscript /home/.../file         


        
3条回答
  •  暖寄归人
    2021-01-15 07:23

    You'll need to have the full path in your foo.sh:

    sudo R CMD BATCH /home/.../file.r
    

    I should also add that the first version worked for me, although I set it to a specific time rather than * * * * *

提交回复
热议问题