Solved Copy file from Windows Server to hosted external CentOS server
-
@fuznutz04 said in Copy file from Windows Server to hosted external CentOS server:
So that works properly if I run it through command prompt. (meaning, it will open WinSCP and login successfully. ) However, for the scheduled task, it appears that it isnt even attempting to read that script.
Note: my password is all normal letters for this test.
What happens if you, in CMD enter in to a WinSCP.exe prompt, then you enter this:
open sftp://<username>:<password>@123.45.67.890:XXXX -hostkey="ssh-rsa 2048 <hostkey>"
Does it connect then?
-
Well we know that the scheduled task is successfully executing WinSCP.exe. That's a given due to the success message.
Now I'm trying to establish whether or not the script is running at all, by finding out if you can connect the same way the script is trying to connect. Using the username and password together when you connect. (as in my above post)
-
@Tim_G said in Copy file from Windows Server to hosted external CentOS server:
Well we know that the scheduled task is successfully executing WinSCP.exe. That's a given due to the success message.
Now I'm trying to establish whether or not the script is running at all, by finding out if you can connect the same way the script is trying to connect. Using the username and password together when you connect. (as in my above post)
So I was able to drop into a Winscp console via command prompt, and issue the
open sftp://<username>:<password>@123.45.67.890:XXXX -hostkey="ssh-rsa 2048 <hostkey>"
command. Followed by all the other commands I need to make that are contained within the script. So it looks like the problem lies within Task scheduler actually launching the script.
-
@fuznutz04 said in Copy file from Windows Server to hosted external CentOS server:
@Tim_G said in Copy file from Windows Server to hosted external CentOS server:
Well we know that the scheduled task is successfully executing WinSCP.exe. That's a given due to the success message.
Now I'm trying to establish whether or not the script is running at all, by finding out if you can connect the same way the script is trying to connect. Using the username and password together when you connect. (as in my above post)
So I was able to drop into a Winscp console via command prompt, and issue the
open sftp://<username>:<password>@123.45.67.890:XXXX -hostkey="ssh-rsa 2048 <hostkey>"
command. Followed by all the other commands I need to make that are contained within the script. So it looks like the problem lies within Task scheduler actually launching the script.
Okay, that leads me to believe you are running the task as a user that doesn't have permission to where the script lives.
-
@Tim_G
Just for testing, the Everyone group has full control of the directory and file of the script. The account being used is the Administrator account, which has full control. Task scheduler is open using "Run as Administrator" for good measure. Still no dice.
-
@fuznutz04 said in Copy file from Windows Server to hosted external CentOS server:
@Tim_G
Just for testing, the Everyone group has full control of the directory and file of the script. The account being used is the Administrator account, which has full control. Task scheduler is open using "Run as Administrator" for good measure. Still no dice.
I mean the task itself, within Task Scheduler.
Like this:
-
@Tim_G
Yep, that's exactly how it's setup now.
-
What does the log file say?
/log=C:\Users\<userProfile>\Desktop\<logName>.log /script=C:\Users\<userProfile>\Desktop\<scriptName>.txt
In my case, the "Add arguments (optional):" field in the Action tab of the scheduled task is as above. It spits out a log file on the desktop. What does your log say?
-
@Tim_G
/log=C:\CallRecordingsTest\Winscp.log /script=C:\CallRecordingsTest\CallRecordings.txt
OR,
If I just have this: /log=C:\CallRecordingsTest\Winscp.log
It will start WinSCP in the background (no GUI, I just know it's running via task manager) but will not put anything in the log file.