Task scheduling using Ruby?

Discussion in 'Ruby' started by nkb, Oct 11, 2004.

  1. nkb

    nkb Guest

    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!!
    nkb, Oct 11, 2004
    #1
    1. Advertising

  2. nkb

    Hal Fulton Guest

    nkb wrote:
    > 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
    Hal Fulton, Oct 11, 2004
    #2
    1. Advertising

  3. nkb

    nkb Guest

    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:
    > nkb wrote:
    >
    >> 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
    >
    >
    >
    >
    nkb, Oct 11, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor
    Replies:
    0
    Views:
    8,826
    Victor
    Sep 1, 2004
  2. krabhi
    Replies:
    1
    Views:
    9,267
    Marco Meschieri
    Aug 9, 2006
  3. Replies:
    1
    Views:
    285
    Victor Bazarov
    Feb 20, 2007
  4. teggy
    Replies:
    0
    Views:
    806
    teggy
    May 29, 2007
  5. Mike
    Replies:
    1
    Views:
    1,921
    GArlington
    May 12, 2008
Loading...

Share This Page