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
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]
- Source code for the main module on github
- Source code for the cron.edit.lua module on github
- API documentation for net.http.respond
- Wikipedia: Cron