{"id":19723122,"url":"https://github.com/bnosac/taskscheduler","last_synced_at":"2025-10-08T06:42:30.776Z","repository":{"id":43642732,"uuid":"54051880","full_name":"bnosac/taskscheduleR","owner":"bnosac","description":"Schedule R scripts/processes with the Windows task scheduler.","archived":false,"fork":false,"pushed_at":"2024-03-17T14:55:05.000Z","size":393,"stargazers_count":338,"open_issues_count":10,"forks_count":72,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-10-04T17:14:56.028Z","etag":null,"topics":["r","rstudio","scheduled-tasks","schtasks","task-scheduler"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnosac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-16T17:16:19.000Z","updated_at":"2025-10-04T14:11:10.000Z","dependencies_parsed_at":"2024-06-21T17:51:36.837Z","dependency_job_id":"c088666c-200b-4702-9126-4d46707c7d02","html_url":"https://github.com/bnosac/taskscheduleR","commit_stats":{"total_commits":57,"total_committers":5,"mean_commits":11.4,"dds":"0.14035087719298245","last_synced_commit":"89cdfdc9b9bd2c325a4c78f29110fca53f98b12f"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/bnosac/taskscheduleR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2FtaskscheduleR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2FtaskscheduleR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2FtaskscheduleR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2FtaskscheduleR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnosac","download_url":"https://codeload.github.com/bnosac/taskscheduleR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2FtaskscheduleR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278903017,"owners_count":26065786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","rstudio","scheduled-tasks","schtasks","task-scheduler"],"created_at":"2024-11-11T23:19:35.399Z","updated_at":"2025-10-08T06:42:30.760Z","avatar_url":"https://github.com/bnosac.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"taskscheduleR\n=========\n\n![taskscheduleR](vignettes/taskscheduleR-logo.png) \n\nSchedule R scripts/processes with the Windows task scheduler. This allows R users working on Windows to automate R processes on specific timepoints from R itself.\nMark that if you are looking for a Linux/Unix scheduler, you might be interested in the R package cronR available at https://github.com/bnosac/cronR\n\n\nBasic usage\n-----------\n\nThis R package allows to \n* Get the list of scheduled tasks\n* Remove a task\n* Add a task\n  + A task is basically a script with R code which is run through Rscript\n  + You can schedule tasks 'ONCE', 'MONTHLY', 'WEEKLY', 'DAILY', 'HOURLY', 'MINUTE', 'ONLOGON', 'ONIDLE'\n  + The task log contains the stdout \u0026 stderr of the Rscript which was run on that timepoint. This log can be found at the same folder as the R script\n\nExample usage:\n\n```\nlibrary(taskscheduleR)\nmyscript \u003c- system.file(\"extdata\", \"helloworld.R\", package = \"taskscheduleR\")\n\n## run script once within 62 seconds\ntaskscheduler_create(taskname = \"myfancyscript\", rscript = myscript, \n                     schedule = \"ONCE\", starttime = format(Sys.time() + 62, \"%H:%M\"))\n\n## Run every day at the same time on 09:10, starting from tomorrow on\n## Mark: change the format of startdate to your locale if needed (e.g. US: %m/%d/%Y)\ntaskscheduler_create(taskname = \"myfancyscriptdaily\", rscript = myscript, \n                     schedule = \"DAILY\", starttime = \"09:10\", startdate = format(Sys.Date()+1, \"%d/%m/%Y\"))\n\n## Run every week on Saturday and Sunday at 09:10\ntaskscheduler_create(taskname = \"myfancyscript_sunsat\", rscript = myscript, \n                     schedule = \"WEEKLY\", starttime = \"09:10\", days = c('SUN', 'SAT'))\n\n## Run every 5 minutes, starting from 10:40\ntaskscheduler_create(taskname = \"myfancyscript_5min\", rscript = myscript,\n                     schedule = \"MINUTE\", starttime = \"10:40\", modifier = 5)\n\n## Run every minute, giving some command line arguments\ntaskscheduler_create(taskname = \"myfancyscript_withargs_a\", rscript = myscript,\n                     schedule = \"MINUTE\", rscript_args = \"productxyz 20160101\")\ntaskscheduler_create(taskname = \"myfancyscript_withargs_b\", rscript = myscript,\n                     schedule = \"MINUTE\", rscript_args = c(\"productabc\", \"20150101\"))\n\n\n## get a data.frame of all tasks\ntasks \u003c- taskscheduler_ls()\nstr(tasks)\n\n## delete the tasks\ntaskscheduler_delete(taskname = \"myfancyscript\")\ntaskscheduler_delete(taskname = \"myfancyscriptdaily\")\ntaskscheduler_delete(taskname = \"myfancyscript_sunsat\")\ntaskscheduler_delete(taskname = \"myfancyscript_5min\")\ntaskscheduler_delete(taskname = \"myfancyscript_withargs_a\")\ntaskscheduler_delete(taskname = \"myfancyscript_withargs_b\")\n```\n\nWhen the task has run, you can look at the log which contains everything from stdout and stderr. The log file is located at the directory where the R script is located.\n\n```\n## log file is at the place where the helloworld.R script was located\nmylog \u003c- system.file(\"extdata\", \"helloworld.log\", package = \"taskscheduleR\")\ncat(readLines(mylog), sep = \"\\n\")\n```\n\nRStudio add-in\n-----------\n\nThe package contains also an RStudio add-in. If you install the package and use RStudio version 0.99.893 or later you can just click to schedule a task. Just click Addins \u003e Schedule R scripts on Windows. Many thanks to ![OliverBLMS](https://github.com/OliverBLMS) \n\n![taskscheduleR](vignettes/taskscheduleR-rstudioaddin.png) \n\nMark that the date format is the date format in Belgium. Change once to your locale if needed. E.g. in the US %m/%d/%Y\n\nInstall\n-----------\n\nThe package is on CRAN. To install, just run:\n\n```\ninstall.packages(\"taskscheduleR\")\n```\n\nIf you want the RStudio add-in to work, also install miniUI and shiny\n```\ninstall.packages('miniUI')\ninstall.packages('shiny')\n```\n\nFor installing the development version of this package: `devtools::install_github(\"bnosac/taskscheduleR\", build_vignettes = TRUE)`\n\n\nMark on administrator rights\n-----------\n\nBy default, to schedule a task, you must be a member of the Administrators, Backup Operators, or Server Operators group on the local computer.\nIf you are not, you can ask your System administrator to make sure you have the rights to execute Schtasks.exe. This is the application this R package connects to.\nSchtasks.exe enables an administrator to create, delete, query, change, run and end scheduled tasks on a local or remote computer.\nIf you are using RStudio, you might need to start RStudio as admin, on Windows this is rightclick \u003e\u003e run as administrator.\n\nMark on error messages\n-----------\n\n- You can only have one task with the same name, make sure you use `taskscheduler_delete` the task if you are planning to create a new task with the same name.\n- Tasks are only run if your computer is on and your cable is plugged in\n- `taskscheduler_create` requires you to give the full path to the R script you want to schedule. \n    - R has many facilities to provide the full path to a file on disk\n    - Some examples include `file.path(getwd(), \"subfolder\", \"yourscript.R\")`, `path.expand(\"~/subfolder/yourscript.R\")`, using `fs::path_abs(\"subfolder/yourscript.R\")`, `normalizePath(\"subfolder/yourscript.R\")`,  `file.path(Sys.getenv(\"YOUR_PROJECT_DIR\"), \"subfolder\", \"yourscript.R\")`. Choose what suites you best to pass the full path on to argument `rscript` of `taskscheduler_create`\n- Consider using the `startdate` argument of `taskscheduler_create` (scheduling something at 9/2/2018 means something different than 2/9/2018 depending on your locale)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnosac%2Ftaskscheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnosac%2Ftaskscheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnosac%2Ftaskscheduler/lists"}