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作业运行的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux计算脚本执行时间,linux
- 下一篇: Linux中添加pycharm源,lin