How to schedule an R Script Cronjob in a linux server? [closed]

自古美人都是妖i 提交于 2019-11-30 20:30:01

The following cron job will run Rscript scriptSecos.R from the path /home/script2, once a day, at 0:00 (midnight).

0 0 * * * cd /home/script2; Rscript scriptSecos.R >/dev/null 2>&1

If you want to save the output of the script to a file, change >/dev/null with >/path/to/file.

You can copy and paste this cronjob in your crontab file (You can open the file by using command crontab –e)

The following site provides useful reference information for crontab

http://www.adminschoice.com/crontab-quick-reference

With your example, the following will run the job at 3 am everyday.

00      03      *       *       *       Rscript /home/script2/scriptSecos.R

add cron as below.

eg:

15 23 * * * Rscript /home/script2/scriptSecos.R  >/dev/null 2>&1

you have to mention running script type.Then allow cron logs and check its running or not

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!