איך להריץ סקריפט Ruby ב-cronjob יומי?

אני צריך להריץ סקריפט פשוטdaily עם פרמטרים ספציפיים כמו זה. כשאני מריץ אותו ידנית:

bundle exec rails runner auto_send_messages_script.rb --messages-limit 3 --sleep-timer 5 --marker welcome_back_campaign_2025 --order-type created_at —-order desc

אני לא רואה שגיאות והכל בסדר, אני חדש ב-Ruby ותוהה אם יש דרך קלה להריץ את הסקריפט הזה ולאינטראקציה עם Discourse.

לייק 1

The Discourse (and Rails) way of doing this would be to create a plugin and run it as a scheduled (sidekiq) Job.

There are loads of plugins with Jobs, have a look through them.

3 לייקים

From an application-development point of view:

:100:

From a systems point of view:

Easiest thing to do is run it on the host.

3 לייקים