Hello Dongcan,
how are you running the code? In IRB?
Try putting your code in a file an run it:
ruby dongcan.rb
Then wait for the "hello" to appear.
> I also want to know whether the "scheduler.join" is necessary in the
> cron job?
The scheduler.join is simply telling the Ruby runtime to join the scheduler
thread so that it doesn't exit immediately.
try running this program:
---8<---
Thread.new do
sleep 1.0
puts "hello"
end
--->8---
then this one:
---8<---
t = Thread.new do
sleep 1.0
puts "hello"
end
t.join
--->8---
See the difference.
> And this cronjob can be seen in the crontab?
No, it cannot. Rufus-scheduler will not touch your crontab, at all.
If you're looking for a Ruby integration with Cron, look at
https://github.com/javan/whenever
Best regards,
--
John Mettraux - http://lambda.io/processi
Hello,
yes, rufus-scheduler can be used on Windows. I haven't tried for a long while
though.