2 # ---------------------------------------------------------------------
3 # Generic databse object dumper.
4 # ./object_dumper.pl <bootstrap_config> <type>, <type>, ...
5 # ./object_dumper.pl /openils/conf/opensrf_core.xml permission.grp_tree
6 # ---------------------------------------------------------------------
10 use OpenSRF::Utils::JSON;
13 my $config = shift || die "bootstrap config required\n";
14 my $lockfile = shift || "/tmp/generate_fines-LOCK";
21 open(F,'/bin/ps axo pid|');
22 while ( my $p = <F>) {
24 if ($p =~ s/\s*(\d+)$/$1/o && $p == $pid) {
25 die "I seem to be running already at pid $pid. If not, try again\n";
31 open(F, ">$lockfile");
35 OpenSRF::System->bootstrap_client( config_file => $config );
37 my $r = OpenSRF::AppSession
38 ->create( 'open-ils.storage' )
39 ->request( 'open-ils.storage.action.circulation.overdue.generate_fines' => 1 );
41 while (!$r->complete) { $r->recv };