MarcusD has asked for the wisdom of the Perl Monks concerning the following question:

Hi, i have a question regarding Net::SFTP::Foreign on Windows 2008R2. If i start the perl script manually everything is fine. If i start the same script over the windows scheduler - the script stops. The user has all rights. Here are the debug log file:
#4372 1426237080.00000 new: This is Net::SFTP::Foreign 1.77 #4372 1426237080.00000 new: Loaded from C:/Perl64/site/lib/Net/SFTP/Fo +reign.pm #4372 1426237080.00000 new: Running on Perl v5.16.3 for MSWin32 #4372 1426237080.00000 new: debug set to -1 #4372 1426237080.00000 new: ~0 is 18446744073709551615 #4372 1426237080.00000 new: Using backend Net::SFTP::Foreign::Backend: +:Windows 1.70_08 #4372 1426237080.00000 _init_transport: ssh cmd: ssh -2 -i d:/xxxxxx/s +sh-keys/xxxx/id_rsa_xxxxx -o UserKnownHostsFile=known_hosts -v xxxxxx +xx -s sftp -------------------------------------------- SAP Transfer Version:1.40 -------------------------------------------- Opening ODBC connection for xxxxxxx -------------------------------------------- Timestamp -------------------------------------------- Timestamp: 20150313095800 -------------------------------------------- -------------------------------------------- Job in_active. FTP Transfer Files from remote to in -------------------------------------------- Transferpath on remotesystem sftp.xxxxxx.eu /xxxxx/ Connect to sftp.xxxxxxx.eu with user saptrans with Mode 1 and options +["-2","-i","d:/xxxxxx/ssh-keys/xxxx/id_rsa_xxxxx","-o","UserKnownHost +sFile=known_hosts","-v"] and file xxxxxx #4372 1426237080.00000 _queue_msg: queueing msg len: 5, code:1, id:3 . +.. [1] 00 00 00 05 01 00 00 00 03 + | ......... #4372 1426237080.00000 _get_msg: waiting for message... [1] OpenSSH_4.7p1, OpenSSL 0.9.8g 19 Oct 2007
any ideas ? Thanks Marcus

Replies are listed 'Best First'.
Re: Net::SFTP::Foreign and Windows Scheduler
by salva (Canon) on Mar 13, 2015 at 10:11 UTC
    That kind of problems are always caused by some difference between the environment provided by the scheduler to the program and the one at the command line.

    You can use some utility as ProcessMonitor to see what is going on at the OS level.

    In any case, post your code!