Solved

how to go "mget" in  psftp as part of the batch  script ? . it is not working for me .

Posted on 2007-11-14
10
7,278 Views
Last Modified: 2013-12-26
dear experts ,

I do have batch script that use  "mget" as part of the script to get files by the psftp procedure ,
when I use this command it is showing me as an invalid command like.

then I tried with get , put it is gone thru, is there any work around for this?
how to use  as part of the script , please advise
0
Comment
Question by:mansur_mca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 20286712
show us the relevant portion of the commands or script you are using now.  Also, run the "prompt" command before the mput or mget commands in your ftp script:

  prompt
  mget *.txt
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 20290971
if mget is not allowed, then you need to use get/put with a full filename
0
 
LVL 1

Author Comment

by:mansur_mca
ID: 20303378
knightEknight,
I tried as u advised by "prompt" command . but it is not went though. As you as asked about log execution , pasted below  

ahoffmann,
I do have set of 50  and more files ,  my requiremment is to  pull/push all these files by the script . as this not possible by the one-by-one process , server also only support psftp rather FTP , looking the solution how to achive this .

Dear experts,
Any advice .. pull/push mltiple  multiple files in one shot in psftp .. detail log are provided  below as that I  tried .
Even  I tried to see what are the possible commands are there by > PSFTP  HELP  , there is so such mget , mput  present or  comand which will suffice my requirement.
========================================
bility@itc.it.com's password:
Remote working directory is /itc/r21dev
psftp> cd /itc/dev/interface/upload
Remote directory is now taca/dev/interface/upload/
psftp> mget *.*
psftp: unknown command "mget"
psftp> put test.txt
local: unable to open test.txt
psftp> put file.txt
local:file.txt => remote:/itc/dev/interface/upload/file.txt
psftp> get file.txt
remote:/itc/dev/interface/upload/file.txt => local:file.txt
psftp> mget file.txt
psftp: unknown command "mget"
psftp> mput file.txt
psftp: unknown command "mput"
psftp> mget *.*
psftp: unknown command "mget"
psftp> mput file.txt
psftp: unknown command "mput"
psftp> mget *.txt

----
psftp> prompt
psftp: unknown command "prompt"
psftp>
------------------------

thanks for all ..... in advance
0
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 20303756
if your ftp client is that stupid you have to feed it with a script around which uses a single get or put with each filename, I'd use expect http://expect.nist.gov/
0
 
LVL 1

Author Comment

by:mansur_mca
ID: 20304045
Thanks for reacting so soon.
I spent some time on the suggested link that u  have given; It is totally new for me.  Not able to summarize what exactly and how to put it action to fit on my requirement.  I will highly appreciate If you already does it,  can u please paste resolution of the question ,atleast I will get the idea and I will take it forward for the next time.


Dear experts,
Any alternate solution on this,  please advice
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 20304805
# just a rough idea how it works:

spawn "/path/to/psftp" remotehost
sleep 3
puts "USER your user here\n"
expect {
  password { send "your password here"; exp_continue;}
  "remotehost-prompt#" { send "put your-filename-here"; exit; }
  timeout    { puts "connection timeout\n"; exit; }
}

# see expect man-page for detailed examples
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 20307429
Hi,

Since your psftp is not supporting mget, can you zip the files as one file, get the zipped file, and unzip it locally?

0
 
LVL 1

Author Comment

by:mansur_mca
ID: 20312428
omarfiied,
This also an excellent trick That I didn’t get before ,this  also well and good.  Hope you agree with me that some of the tricks comes with  time.

Thanks any way …
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20312445
Hi,

This is called innovation :) (just jocking)
0
 
LVL 1

Author Comment

by:mansur_mca
ID: 20322275
ohh great fun with you,  
your idea solved mys issue .

great @ keep this up always
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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