How to run an R script in crontab

前端 未结 3 1739
不知归路
不知归路 2021-01-15 06:44

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:45

    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 * * * * *

提交回复
热议问题