FTP サーバーからファイルを取得し、システム コマンドを実行する perl スクリプトを実行しています。
スケジューラからタスクを実行すると、ファイルは取得されませんが、システム コマンドは実行されます。どちらも if ステートメントで囲まれているので、if ステートメントが正しく機能していることがわかります。
権限は既に確認しましたが、タスクは最高の権限を使用しています。また、管理者としてタスクを実行しています。問題は、プログラムを手動で実行すると、すべてが正常に機能することです。手動で実行すると正しく実行されるのに、スケジューラを介して実行すると正しく実行されないのはなぜですか?
コードの一部を次に示します。
if ($size_ftp == $size_local) {
print "Files are the same...\n";
$ftp->quit;
print "FTP has quit!\n";
} else {
print "Files are not the same...begin download!\n";
$ftp->get($file_ftp) or die "get failed ", $ftp->message;
print "Download complete...\n";
$ftp->quit;
print "FTP has quit!\n";
my $Archive_file = Archive::Extract -> new( archive => $file_dir );
print "File extraction identified...\n";
$Archive_file -> extract( to => $extract_here );
print "File extracted...\n";
system('call "C:\QMSEDX.exe"');
print "System EDX call completed!\n";
}