كيف يمكنني تشغيل سكربت Ruby في cron يومي؟

I need to run a simple script daily with specific parameters like this. When I run it manually:

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

I see no errors and everything is fine, I’m new to Ruby and wonder if there is an easy way to run this script and interact with 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 إعجابات