Solved

PSFTP Automation using batch file

Posted on 2009-05-06
7
2,181 Views
Last Modified: 2013-12-09
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
Comment
Question by:jsears1979
  • 3
  • 2
7 Comments
 
LVL 28

Expert Comment

by:lesouef
ID: 24322884
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
 

Author Comment

by:jsears1979
ID: 24329856
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
 
LVL 28

Expert Comment

by:lesouef
ID: 24330217
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:jsears1979
ID: 24338325
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
 
LVL 28

Accepted Solution

by:
lesouef earned 500 total points
ID: 24340318
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
 
LVL 8

Expert Comment

by:Rsulliv1
ID: 34941454
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In this article, we will look at our content management system as a whole, to get an idea of how we will start to manage these content items.
As a financial services provider, your business is impacted by two of the strictest federal regulations on record: the Sarbanes-Oxley Act and the Gramm-Leach-Bliley Act. Correctly implementing faxing into your organization to provide secure, real-ti…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now