[tpm] Flexible scheduling scripts

Kartik Thakore thakore.kartik at gmail.com
Wed Sep 30 14:18:37 PDT 2009


Hi all,

After building an arsenal of Perl scripts to ease my work load I am  
looking for a way to schedule this perl scripts. When I say flexibilty  
I would like to be able to change a text file the scheduler is running  
against and not have to restart the scheduler.

Here is my idea:

Tasks.conf
--------------
script= some.pl args args
time = 1430

Scheduler.pl
----------------

sub check_sum_file ()
{
   $new = gen_check_sum;
   if ($new != $old)
          {
            $old = $new;
           return 1;
           }
return 0;
}

sub reload
{
....
# copy old file to tmp file
# replace old filehandle
}

while(1)
{
    reload if check_sum_file;

    foreach $node ( $nodes)
    {
      system $node->script
       if $node->time == time
    }
}


Is there a better way to accoplush this. One problem I see is that if  
the conf file is huge it will kill the memory.

Kartik Thakore


More information about the toronto-pm mailing list