Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2290
  • Last Modified:

PSFTP Automation using batch file

Hello,
I have been looking forever and I just cant make sense of the process to automate a process using batch files and psftp from windows 2k3 to an sftp site.
I was able to write a ssh script that opens the psft application, inputs the correct login sequence informatino and transfers the files. The only issue here is that it can only run when i am logged into the server. I need to be able to create batch files that will automate the process, but cant find too much information on the web to do this.
Any help would be greatly appreciated.

Thank You,
jsears1979
0
jsears1979
Asked:
jsears1979
  • 3
  • 2
1 Solution
 
lesouefCommented:
in theory you can use the windows schedule to trigger this with no open session. Just specify which account should be used to start the task if specific rights are required, otherwise system account rights will be used. Normally everythin whihc can be lauched from the command line with no other user interaction can be launched this way; visible from the desktop depens on task parameters, and if a session is open. Ig no session is open errors will be logged in the event viewer.
0
 
jsears1979Author Commented:
Here is the process that I am currently using...
Batch file is scheduled to open psfp application, change the name of the file and run the ssh script that inputs the information into the psftp prompts. The ssh script inputs the correct information, deletes the file upon successful upload and exits/closes the psftp application. Again, this works flawlessly when I run it manually by double clicking the first batch file to kick off the whole process... the problem is that when I schedule it and it tries to run when I am not logged in, it cant open the psftp application. I have full admin rights to the server, so I do not think that is the issue. It is more an issue of getting an psftp session to run when I am not logged in.

Thanks
0
 
lesouefCommented:
why don't you run psftp directly? why is ssh required to input "correct information" and delete a file?
this whole thing could be a regular shell script doing the "pre" and "post" steps, and call psftp in between with the right arguments?
have you tried to change the account starting the scheduled task or not?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jsears1979Author Commented:
This is on a server and it needs to be a scheduled task to run in the evenings nightly. I cant run psftp directly unless i want to log into the server every night and open it. I use my account on the server which has complete admin priveleges. I have tried using another service account as well as1 other admin ID. The shell script would use the send keys command to type in the account and login information without a user having to do it.
0
 
lesouefCommented:
I am not with you... as far as I know psftp can take all the parameters it needs from the command line arguments; so if you make a shell script of that, the scheduler should be able to do this, there is no need for keyboard entries or sendkeys. if its prompts for question, its because you are missing arguments like -pw
0
 
Rsulliv1Commented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now