How open PSFTP via AT scheduler & pass variables?

P

PS

Dear Sir or Madam:

I can open PSFTP using AT scheduler; however, what's the
proper syntax to pass in variables? I have done some
research. I think batch files can handle this task. VBS &
WS seem to be overkill.

My objecive is to transfer 4 hours worth of log files from
a SVR to a local box after midnight.

I assume it would be done this way:

Use AT to open PSFTP (done)

Pass these VARs to PSFTP via batch file?

psftp> open 'ip address'
login as> 'user'
password> 'pw'
psftp> cd 'directory'
psftp> 'get filename c:\filename'
psftp> exit

Thank you in advance for your assistance.

:)
 
S

Scot Wiedenfeld

PS said:
Dear Sir or Madam:

I can open PSFTP using AT scheduler; however, what's the
proper syntax to pass in variables? I have done some
research. I think batch files can handle this task. VBS &
WS seem to be overkill.

My objecive is to transfer 4 hours worth of log files from
a SVR to a local box after midnight.

I assume it would be done this way:

Use AT to open PSFTP (done)

Pass these VARs to PSFTP via batch file?

psftp> open 'ip address'
login as> 'user'
password> 'pw'
psftp> cd 'directory'
psftp> 'get filename c:\filename'
psftp> exit

Thank you in advance for your assistance.

:)

Try this:

Note: The following script assumes you have already added they key to
PuTTY's cache, else you will need to add a "y" prior to the username.

Create a file with your commands in it (including the {ENTER} key and direct
it into your initial PSftp connection e.g.:

Step 1 Create a file (for example) called pscom.txt

pscom.txt
for {ENTER}Don't actually type ENTER, just hit the "Enter" key
Enter variables as required below the ---------- into this file and save it
----------
username{ENTER}
{ENTER}
password{ENTER}
{ENTER}
cd directory{ENTER}
{ENTER}
get filename c:\filename{ENTER}
{ENTER}
quit{ENTER}
{ENTER}

Step 2 create a batch file (for example) called go.bat to kick the command
and eat your psftp file.

go.bat
Enter as seen below the ----------
----------
psftp your.host.name <fcom.txt

Step 3

Run go.bat

Walaa,
Hope this works for ya

Just my 2.0134 cent worth (tax included)
Scot Wiedenfeld
 
M

Michael Bednarek

[snip]
Pass these VARs to PSFTP via batch file?

psftp> open 'ip address'
login as> 'user'
password> 'pw'
psftp> cd 'directory'
psftp> 'get filename c:\filename'
psftp> exit

Put these commands in a file, say SCRIPT.FTP, and use that as a
redirection source for your program's stdin, like so:
PSFTP <SCRIPT.FTP
 
G

Gregory Mamayek

Thank you for responding. I had posted this using browser at MS, but
couldn't find post using browser. Finally found it in newsgroup. LOL

I will try that. Thank you again.
 
Joined
Sep 29, 2008
Messages
1
Reaction score
0
Hi,

The above methods works well if the Filename is already now. What if the filename is dynamic like created based on Date and has to ftp.
I have this issue and i am unbale to pass the Filename to PSftp file.

Please help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top