Git Bash を使用して Windows 8 で次のスクリプトを実行しています。手動で実行すると正常に動作します--scp、ssh などはすべて正常に動作します。ただし、タスクスケジューラに入れると機能しません。タスク スケジューラは scp で停止します ... scp コマンドを実行しません。スケジューラで、エラー メッセージやエラー ログが表示されません (ログ ファイルの場所がわかりません)。
私が使用している: 最高の権限で実行 UNCHECKED; Windows 8 用に構成します。
Wscript.echo "Running abc.exe"
Set objShell = CreateObject("WScript.Shell")
Return = objShell.Run ("C:\abc.exe /S", 1, true)
Wscript.echo "Done Running abc.exe"
WScript.Sleep(5000)
Wscript.echo "Done sleeping"
dim fileSystem
Set fileSystem = CreateObject("Scripting.FileSystemObject")
Return = objShell.Run ("scp -i c:/users/uname/.ssh/id_dsa /c/data/*.txt admin@svr3.com:/mnt/wnd01/txt",0,true)
Wscript.echo "Uploading file, Return message " & Return
if Return = 0 then
WScript.Sleep(5000)
Wscript.echo "Done sleeping on scp"
fileSystem.MoveFile "C:\data\*.txt","C:\data\archivefiles"
Return = objShell.Run ("ssh -i c:/users/uname/.ssh/id_dsa admin@svr3.com '/opt/drupal/scripts/import_raw.sh wnd01'",0,true)
end if
Wscript.echo "Running DB script on server, Return message " & Return
何が起こっているのかを理解するための助けをいただければ幸いです。