更に先程のエントリの続きです
http://amon.64p.org/cli.html
↑こちらに記載されている通りですけど、bootstrap() でコンテキストを取得できるので、後は、DB処理等をお好きに
#!/usr/local/bin/perl use strict; use FindBin; use File::Spec; use lib File::Spec->catdir($FindBin::Bin, '/amon2/TestAmon2App/lib'); use TestAmon2App; use Data::Dumper; main(); sub main { my $c = TestAmon2App->bootstrap(); $c->info('This is info log for test by batch program.'); #後はお好きに... }