2 # ---------------------------------------------------------------------
4 # hold_targeter.pl <config_file> <lock_file>
5 # ---------------------------------------------------------------------
12 my $config = shift || die "bootstrap config required\n";
13 my $lockfile = shift || "/tmp/hold_targeter-LOCK";
20 open(F,'/bin/ps axo pid|');
21 while ( my $p = <F>) {
23 if ($p =~ s/\s*(\d+)$/$1/o && $p == $pid) {
24 die "I seem to be running already at pid $pid. If not, try again\n";
30 open(F, ">$lockfile");
34 OpenSRF::System->bootstrap_client( config_file => $config );
36 my $r = OpenSRF::AppSession
37 ->create( 'open-ils.storage' )
38 ->request( 'open-ils.storage.action.hold_request.copy_targeter' => '24h' );
40 while (!$r->complete) { $r->recv };