Task scheduling using Ruby?

N

nkb

Hi.
I would like to schedule a task (e.g check if a file exists or if the
date of the files in a diretory are newer than yesterday, etc.) on Linux
using Ruby. Can this be done, if so how? I supposed I would run the
script as root background? Thanks for any pointer!!
 
H

Hal Fulton

nkb said:
Hi.
I would like to schedule a task (e.g check if a file exists or if the
date of the files in a diretory are newer than yesterday, etc.) on Linux
using Ruby. Can this be done, if so how? I supposed I would run the
script as root background? Thanks for any pointer!!

Gavin Kistner released something two weeks ago that might interest you:
http://phrogz.net/RubyLibs/rdoc/classes/Dir/DirectoryWatcher.html

A DirectoryWatcher keeps an eye on a certain directory, firing off your own custom
procs when a file is added to, modified in, or removed from that directory.

See the link above for documentation. Download available from
http://phrogz.net/RubyLibs/DirectoryWatcher.rb


If that doesn't get you in the right direction, ask us again...


Hal
 
N

nkb

Thanks.
I downloaded DirectoryWatcher.rb.
I copied and pasted the codes under the Example: section (uncommented
them) to the end of the DirectoryWatcher.rb. And instead of using
'plugins/devices', I replaced it with 'C:/temp'.
I ran DirectoryWatcher.rb at my command prompt on windowsXP. Nothing
happens when I change or add files to the C:/temp.
What am I missing? Thanks.

Hal Fulton wrote on 2004/10/11 17:18:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top