Link to home
Start Free TrialLog in
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,

Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

how do you pass password ? can you post script ?
Avatar of sportzzphann
sportzzphann

ASKER

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
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Very Good...