linux期末脚本作业,linux – 使用R Markdown将bash脚本作为Cron作业运行

我想尝试如何从R markdown文件渲染html,但是从作为Cron作业运行的bash脚本中渲染.我不知道为什么一切正常,除了作为Cron工作运行.我所做的:

我的脚本是Rstudio的演示脚本

---

title: "test"

author: "sms"

date: "24 maja 2015"

output: html_document

---

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see .

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r}

summary(cars)

```

etc.

这个脚本在Rstudio中没有任何问题.

接下来我尝试从终端运行Rmd脚本:

Rscript -e "require( 'rmarkdown' ); render('/home/sms/Dokumenty/R/test.Rmd', 'html_document')"

没有任何问题.有用.

所以我创建了bash脚本

#!/bin/bash

Rscript -e“require(‘rmarkdown’); render(‘/ home / sms / Dokumenty / R / test.Rmd’,’html_document’)”

并更改了chmod 755 test.sh

也像魅力一样.

但是当放入Cron文件(管理员和用户)时:

28 18 * * * sh /home/sms/Dokumenty/R/test.sh

它不起作用

知道我做错了什么吗?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值