Closed sanjmeh closed 3 years ago
Can you provide a reproducible example?
Here is a reprex:
Please save a file with the following test code. Let's name it test.R
# test.R for testing cronR package
setwd("/home/rstudio/omni") # this can be changed to any path on your system
library(readr)
library(magrittr)
list.files(".") %>% write_lines("~/allfiles.txt")
Then I create the command using this script:
cmd_reprex <- "/usr/lib/R/bin/Rscript '/home/rstudio/omni/test.R' >> '/data/test.log' 2>&1"
Then I start the cron process by adding this into crontab by using the following cronR
function.
cronR::cron_add(cmd_reprex,frequency = '*/5 * * * *',id = "reprex1",tags = "reprex_sm",description = "to demonstrate the crontab error",user = "rstudio")
Attaching screenshot of the error received on running the above command. Despite this error, the contab is updated in the Ubuntu 16.04 system file. So this is not a show stopper. But still wanted you to know. And perhaps this has an underlying problem that may trouble us later.
Thanks for the bug report. The error is fixed in https://github.com/bnosac/cronR/commit/8c2e196f1f826bac39b7a1b70d8f1ea088a972ae
Hi I get this every time:
crontab: usage error: no arguments permitted after this option
But thecronR::cron_add()
goes ahead and adds successfully in the system crontab as I confirm bycrontab -l