Re: auto restarting in crontab
"pyh@ymail.ne.jp" <pyh@ymail.ne.jp> wrote:
> debian-user@howorth.org.uk wrote:
> > But it sounds like whatpyh@ymail.ne.jp is doing isn't best practice
> > either, although I don't fully understand what they mean by "I often
> > change default ruby in interactive shell". If they mean 'global'
> > then I suspect they should be using 'local' instead. Or just
> > possibly 'shell'.
>
> I installed ruby only in my personal account, not the global.
> Sometimes I was using the older ruby version (1.x), but sometimes I
> am using the latest ruby (3.x). For example, different streaming
> libraries for ruby require different versions.
>
> For instance, I developed a ruby client for Kafka streaming, and
> deployed it in crontab, and this script must use ruby 3.x version.
>
> 0 * * * * ruby kafka-consumer.rb
>
> But one day I changed the default version in my personal path to ruby
> 1.x via rbenv, the crontab above should not work. This is a risk, is
> it?
You're using terms I don't recognize from my brief reading of the docs.
But it seems you're doing things that I don't see mentioned there, and
that you have older ruby versions that I don't expect to see. So I
suggest reading the docs and trying to follow them. I believe your
kafka-consumer should be set up with rbenv local so it doesn't matter
what you say in the crontab.
> regards
> Yong
Reply to: