Edit a crontab

Introduction

This example shows how to use the cron.edit module to read a crontab.
Note: It is also possible write to a cron tab, be cautious with writing to crontabs

If you have any questions please contact us at support@interfaceware.com.

Using the Code [top]

  • Import the Edit a crontab from the Builtin: Iguana Files repository
  • Experiment with the code to find out how it works
  • Then add the module to your Translator project
  • Copy the require statement from the channel and add it at the top of your script
    Note: This module uses require to return a table
  • Adapt the code to your own requirements
  • Use cron.read() to read a crontab, and cron.write() to write to a crontab
  • Interactive scripting help is included for this module

This is the github code for the main module:

How it works [top]

The channel is very simple it uses cron.read() to read the current crontab for the user, then it sends the contents to a web page like http://localhost:6546/crontab specified in the channel Source settings.
Note: You can also use the cron.write() to write to a crontab (caution is recommended).

Here is the URL Path setting:

More information [top]

 

Leave A Comment?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.