I wrote a script using the Net::SFTP::Foreign module for performing unattended sftp file transfers. The script works beautifully from the command line on any platform. It also performs without problems when called from cron on MacOS X or on Redhat Linux. However when I try to run the same script from cron on HP-UX or AIX, it fails with a broken pipe error. The failure is
open2: exec of ssh -l user some.location.com -s sftp failed at /usr/local/lib/perl5/site_perl/5.8.0/Net/SFTP/Foreign.pm line 67
Additionally, HP-UX complains about write to ssh pipe error, while AIX complains about a read from ssh pipe error. The setup uses an RSA key, so the script does not prompt for any user input. Does anyone know what is going on and/or how I might be able to coax this script to run from cron?