日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

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

發布時間:2024/9/15 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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

它不起作用

知道我做錯了什么嗎?

總結

以上是生活随笔為你收集整理的linux期末脚本作业,linux – 使用R Markdown将bash脚本作为Cron作业运行的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。