Solved

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

Posted on 2014-01-13
3
739 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 78

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

685 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