Solved

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

Posted on 2014-01-13
3
713 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 76

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
what is the meaning of filesystem loop detected? 7 836
aix tls version 6 159
dot directory in FreeBSD??? 4 60
Sed question 2 48
We all know how boring and exhausting it is to transfer huge web projects developed locally to a webserver simply via FTP. The File Transfer Protocol is a really nice solution if you need to transfer small amounts of files, but if you're plannin…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
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…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now