How to input a script in Ruby Console


  • Used Zammad version: 5.4.0-1680612797.66e35235.bullseye
  • Used Zammad installation type: package
  • Operating system: Debian (Server), Windows 10 (Client)
  • Browser + version: Versión 112.0.5615.49

Issue Description:

Hello, I have a doubt, we’re having some tickets often with the HTML processing issues due to the quantity of articles in the ticket or the size of attachments, etc.

It is solved using the script to reprocess tickets described in the following post:

We would like to schedule a script to be executed out of office standard shift but i am not sure how can I input this script in the Ruby console in order to schedule it in the Debian crontab to be executed automatically.

Any help or advice would be appreciated.

Best Regards,

I just asked this question to ChatGPT and unexpectedly it gave me a solution that works (or seems like). :upside_down_face:

The command needed to input the script in the Zammad Rails Console is:

sudo zammad run rails runner -e production 'load "/route/to/your/script.rb"'

I just needed to create an bash script that calls the rb script and put it in the crontab. It should work properly.

Or you’d actually look in the documentation that comes with a on board method and in much shorter.

1 Like

I did at first actually, but thought that it was only able to send a single command and not a script with:

zammad run rails r '{COMMAND}'

I suppose i am missing something, in any case thank you for the support. :smiley:

replacing '{COMMAND}' with /opt/zammad/mysuperamazingscript.rb will do the trick


Many thanks for the advice, will try it then!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.