1

I would like to run a crontab every day at 12h. So I defined a path to my Script with the following syntax: 00 12 * * * sudo R CMD BATCH /home/.../test.R

In order to test that I just ran:

sudo R CMD BATCH /home/.../test.R

And get the message:

basename: extra operand ‘.R’
Try 'basename --help' for more information.

I tried many combinations but nothing seems to work. Maybe one has an advice?

3
  • Hi, can you tell me what you want to achieve with this cron ? May be we could help you more if we know know more. Thank you.
    – Raja G
    Nov 25, 2015 at 18:34
  • No hard feeling on close voter , Bro Ubuntu is A Linux OS . And this question about linux. Thank you.
    – Raja G
    Nov 25, 2015 at 18:35
  • I would like to run a R-Script on daily basis.
    – Mamba
    Nov 25, 2015 at 18:39

1 Answer 1

1

Try following Rscript filePath.R

I mean your cron entry get modified as

00 12 * * * sudo Rscript /home/.../test.R

Let me know if any issues.

2
  • Perfect!!!!!THX Just one additional remark. Is there a way to pass a .txt file after Rscript like 00 12 * * * sudo Rscript --slave /home/.../test.R /home/.../errors/error.txt ?
    – Mamba
    Nov 25, 2015 at 21:03
  • well , stackoverflow.com/questions/4808169/…
    – Raja G
    Nov 26, 2015 at 4:41

Not the answer you're looking for? Browse other questions tagged .