Scheduling Scripts

Author

Neha Moopen & Jelle Treep

Published

November 2, 2023

Note
  • Date: Wednesday, 2nd November 2023
  • Time: 15:00-17:00
  • Location: Bestuursgebouw Bucheliuszaal 6.18, University Library (Utrecht Science Park)
  • Presentation: Scheduling Scripts
  • Presenter: Neha Mooopen & Jelle Treep

Automate the boring things using the schedulers on your computers!

In this edition of the Programming Cafe, we familiarized ourselves with the schedulers available on our operating systems. Windows Task Scheduler & cron. We learnt how we could use these schedulers to automate the execution of scripts. We also touched upon scheduling cron jobs with GitHub Actions.

Slides

Exercise

After the presentation, we invite you to try out the scheduler on your operating system yourself!

We have prepared some R & Python scripts that you can utilize for this. You can download the materials here: exercises.zip.

Don’t forget to unzip the folder to an accessible location on your system.

Windows

  1. Go to windows/r and double-click on scheduling-scripts.Rproj to open RStudio.

  2. Open the countdown.R script from your Files pane and run the script once to make sure it works.

  3. If the script works fine, you can try scheduling it using Windows Task Scheduler.

  1. Go to windows/python and double-click on countdown.py to open it.

  2. Run the script to make sure it works.

  3. If the script works fine, you can try scheduling it using Windows Task Scheduler.

MacOS

  1. Go to macos/r and double-click on scheduling-scripts.Rproj to open RStudio.

  2. Open the countdown.R script from your Files pane and run the script once to make sure it works.

  3. If the script works fine, you can try scheduling it using cron.

  1. Go to macos/python and double-click on countdown.py to open it.

  2. Run the script to make sure it works.

  3. If the script works fine, you can try scheduling it using cron.

Linux

  1. Go to linux/r and double-click on scheduling-scripts.Rproj to open RStudio.

  2. Open the countdown.R script from your Files pane and run the script once to make sure it works.

  3. If the script works fine, you can try scheduling it using cron.

  1. Go to linux/python and double-click on countdown.py to open it.

  2. Run the script to make sure it works.

  3. If the script works fine, you can try scheduling it using cron.

References

  1. https://www.tomsguide.com/how-to/how-to-use-task-scheduler-on-windows

  2. https://itsfoss.com/cron-job/