Petee, It sounds like an environment issue. In your cron job wherever you are executing the perl script, just run perl -v.
Do you get the same results as when you run it interactively? Thanks, Mark Vaughan Professional Services Direct: +1 303 802 1760 Fax: +1 303 802 1420 mark.vaug...@evolving.com Evolving Systems 9777 Pyramid Court, Englewood, CO 80112 www.evolving.com > -----Original Message----- > From: Piotr Szlązak [mailto:piotr.szla...@gmail.com] > Sent: Thursday, July 08, 2010 3:07 PM > To: arsperl-users@arsperl.org > Subject: [Arsperl-users] ARSperl script in crontab > > Hi! > I'm want to create script for report generation. Script should be > executed by crontab. > This is a bash script which executes Perl script which is using > ARSperl. Then bash script sends Perl script output via email. > > When this bash script is executed directly from CLI it runs fine. When > executed via crontab - every time it ends with segmentation fault. > Also Perl script executed via crontab ends without any error. > After some checks I found out that it is enough to use ars_Login > subroutine to get this error. > > Basic script: > > cat ARSperl-script.pl > #!/usr/bin/perl > > use strict; > use ARS; > my $server = 'server.address.com'; > my $user = 'username'; > my $pass = 'password'; > > #Logging in to the server > ( my $ctrl = ars_Login( $server, $user, $pass ,'', '', 2121, '' ) ) > || die "ars_Login failed: $ars_errstr"; > print "Connected...\n"; > > ars_Logoff($ctrl); > > Bash script which is executed via crontab: > > cat ARSperl-report.sh > #!/bin/bash > > /full/path/to/script/ARSperl-script.pl >> /dev/null 2>&1 > > I checked that Perl script gathers needed data and gives proper > output. But I'm always receiving similar mail from Cron daemon: > /full/path/to/script/ARSperl-report.sh: line 3: 3599 Segmentation > fault /full/path/to/script/ARSperl-script.pl >> /dev/null 2>&1 > > Exit code for this Perl script execution is 139. But as I mentioned - > only when bash script is executed via crontab. > > I need to have clean exit code, because after Perl script call, I'm > making decision what should be sent - Perl script output or only > warning about problems. > > Can somebody check if same problem occurs on its platform? Maybe > somebody knows how to solve this problem? > > Perl version: 5.10.1 > ARSperl version: 1.91 > ARS API version 13 > OS: Debian Linux > > -- > petee > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > > -- > Arsperl-users mailing list > Arsperl-users@arsperl.org > https://lists.sourceforge.net/lists/listinfo/arsperl-users The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential information and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Evolving Systems TIS at t...@evolving.com and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. To ensure regulatory compliance and for the protection of our clients and business, Evolving Systems may monitor and read e-mails sent to and from its servers. Although Evolving Systems routinely screens for viruses, addressees should scan this e-mail and any attachments for viruses. Evolving Systems makes no representation or warranty as to the absence of viruses in this e-mail or any attachments. Registered Office: One Angel Square, Torrens Street, London. EC1V 1PL. Registered number 2325854 ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first -- Arsperl-users mailing list Arsperl-users@arsperl.org https://lists.sourceforge.net/lists/listinfo/arsperl-users