Link to home
Start Free TrialLog in
Avatar of nav2567
nav2567Flag for United States of America

asked on

Using PSFTP.EXE to copy differential data from a remote SFTP site to a local UNC path.

I am trying to use psftp.exe to copy files from an external SFTP site to a local UNC path.  

The command I use is "psftp.exe server1.xyz.com -b task.txt -l username

In my task.txt file, I have the following:
      lcd "\\localserver\file path"
      cd remote_file_path
      mget "*.*"

Questions:
1. I am using -l to specify the username.  How do I specify the password?
2. When I use mget "*.*", I am copying all files from the remote sftp server to my local file server.  
Is there a way I can copy only the differential data to the local UNC path?

Please advise.

Many thanks.
Avatar of Mazdajai
Mazdajai
Flag of United States of America image

There is no build-in mechanism for psftp to understand differential data, so the answer is no.

You can use the -pw option or key pairs. For instance -

Try -

psftp -pw 'password' username@server1.xyz.com -b task.txt 

Open in new window

If psftp is an option so is pscp

pscp username@remotehost:/path/to/file store_here
pscp -r username@remotehost:path/to/directory/* strore_here

using puttygen and pageant you can have public key authentication rather than password/interactive.
ASKER CERTIFIED SOLUTION
Avatar of mikelfritz
mikelfritz
Flag of United States of America 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