Start Moodle dl periodically or via Telegram - C0D3D3V/Moodle-DL GitHub Wiki

To start moodle-dl periodically, you can create a cron-job on your Unix-System, which starts moodle-dl every 15 min:

  1. run crontab -e

  2. Add */15 * * * * cd "/absolute/path/to/moodle/folder" && moodle-dl >/dev/null 2>&1

    On MacOs you have to use the absolute path to moodle-dl see #122. You can get the absolute path to moodle-dl by running which moodle-dl (normaly the path is /Users/your_user/Library/Python/3.8/bin/moodle-dl)

    Write MAILTO="" in the first line to stop cron from sending mails when an error occurs.

  3. Save and you're done! (to save in vim press [ESC], then ":x" and then [Enter])

  • Make sure the cronie service is running.

To start moodle-dl via telegram you can run the following script 24/7 on your server:

https://gist.github.com/C0D3D3V/26e02b8312f1fcac5aedf4efb086724b

To start the moodle-dl send /start to your bot. You just have to be careful that your bot is not public :D otherwise everyone can start your moodle-dl.

Command to run this script: python moodle_dl_telegram_bot.py

You can put this script (after changing the variables) into the autostart of your server.