Solved

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

Posted on 2014-01-13
3
725 Views
Last Modified: 2014-01-30
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.
0
Comment
Question by:nav2567
3 Comments
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39779799
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

0
 
LVL 77

Expert Comment

by:arnold
ID: 39779927
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.
0
 
LVL 14

Accepted Solution

by:
mikelfritz earned 500 total points
ID: 39781011
If you use ssh you can use rsync over ssh and that will do differential data.


rsync -avz -e "ssh" server1.xyz.com:/remote_file_path/  /local_file_path


There are lots of tutorials out there for doing this - here's one:

https://www.digitalocean.com/community/articles/how-to-copy-files-with-rsync-over-ssh
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

803 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