Avatar of sportzzphann
sportzzphann asked on

Issues automating a psftp batch file

I am having issues automating a batch file using the windows task scheduler.   The worst part is this process was working for years, and now it does not.  

Background.

I am transferring files to a 3rd party vendor via SSH2 using psftp.exe.  I have a batch file that performs the following process:

1.  runs ftp command to get the data from my Unix server.
2. copies the files to a location on the windows server and renames them.
3. launches psftp.exe from the directory where these files are stored.
4. put commands to place them on the 3rd party server.
5. deletes the files from the window directory.

If I run this batch file manually, the process works flaulessly.  When I try and schedule this through Windows task scheduler, it is failing at between step 3 and 4.  

The issue started last week when the 3rd party vendor changed SSH servers.  I updated the batch file with the new information, but then started to experience the issue above.  

Any help will be greatly appreciated.

Thanks,

Server Software

Avatar of undefined
Last Comment
ashishbansal

8/22/2022 - Mon
omarfarid

how do you pass password ? can you post script ?
ASKER
sportzzphann

Please see below:  This is a copy of the script that I am running.  


ftp -s:d:\televoxupload\thursdayfiletransfer.txt
copy d:\televoxupload\televox d:\televoxupload\appt.dat
copy d:\televoxupload\housecallh d:\televoxupload\hcalls.dat
copy d:\televoxupload\mastrosat d:\televoxupload\Mhc.dat
psftp.exe sshserver.com -l sportzzphann -pw Ph1ll135 -b uploadcommands.txt
del televox
del appt.dat
del housecallh
del hcalls.dat
del mastrosat
del Mhc.dat
SOLUTION
omarfarid

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
sportzzphann

I didn't give you real user information.


I have tried what you have suggested, the psftp.exe process is launching.   I can see it in my task manager, but I can't actually see the application on the screen and it the process just sits there.  The scheduler says it is running, but nothing is occurring.  The files are showing pulling from the Unix server and sitting in the \\televoxupload\ directory.  

If I manually kill the psftp.exe process, it continues to run the batch file and the file are deleted from the directory.  Unfortunately, they were never transferred to the 3rd party vendor.  

I have tried changing the account which is running the scheduled task, but with no success.  

FYI

The psftp.exe is located in the same directory as the batch file.  This is why I didn't have the full path inclucded in the script.  I don't think it is necessary, but I am still learning this stuff, so I gave your idea shot.  

Thanks

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ashishbansal

Very Good...