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";
15 my $grace = int(shift()) || 1;
22 open(F,'/bin/ps axo pid|');
23 while ( my $p = <F>) {
25 if ($p =~ s/\s*(\d+)$/$1/o && $p == $pid) {
26 die "I seem to be running already at pid $pid. If not, try again\n";
32 open(F, ">$lockfile");
36 OpenSRF::System->bootstrap_client( config_file => $config );
38 my $r = OpenSRF::AppSession
39 ->create( 'open-ils.storage' )
40 ->request( 'open-ils.storage.action.circulation.overdue.generate_fines' => $grace );
42 while (!$r->complete) { $r->recv };