Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run/test all cron jobs #45

Open
laresbernardo opened this issue Aug 31, 2021 · 1 comment
Open

Run/test all cron jobs #45

laresbernardo opened this issue Aug 31, 2021 · 1 comment

Comments

@laresbernardo
Copy link

laresbernardo commented Aug 31, 2021

Hi! Is it possible to run all existing (or selected) cron jobs with a command without having to edit their original timings? With cron_ls() I see all the cron jobs I have, but I don't find an easy way to those with a single command, without editing all cron jobs.

Something like this (over-simplified) would work:

cron_test <- function(){
  temp <- cronR::cron_ls()
  temp2 <- strsplit(temp, "\n")[[1]]
  temp3 <- temp2[grepl(">>", temp2)]
  cmnds <- gsub("  >>.*", "", gsub(".*/usr/local/lib64/R/bin/","",temp3)) #fix to match any case
  invisible(lapply(cmnds, system))
}
@jwijffels
Copy link
Collaborator

There is no such function implemented in the package.
Maybe such a function can be implemented if people use the default settings of cron_add or cron_rscript, but I'm not sure if such thing can be implemented for all use cases of the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants