Avatar of nav2567
nav2567
Flag 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.
SSH / Telnet SoftwareUnix OS

Avatar of undefined
Last Comment
mikelfritz

8/22/2022 - Mon
Mazdajai

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

arnold

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
mikelfritz

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes