cronR icon indicating copy to clipboard operation
cronR copied to clipboard

Run/test all cron jobs

Open laresbernardo opened this issue 3 years ago • 1 comments

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))
}

laresbernardo avatar Aug 31 '21 16:08 laresbernardo

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.

jwijffels avatar Sep 01 '21 09:09 jwijffels