Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- How SCP/SFTP works
- Gerhard Rauter
April 10, 2007, 7:33 am
rate this thread
I am new with SSH/SCP/SFTP and I have a question about how SCP/SFTP works on
I want to implement a solution in which one Application copies files via
SCP/SFTP to a server share where a listener looks every few minutes for new
files with a defined extension (i.e. .xml). But it must not be that the
listener tries to read (and after reading to delete) a file that is
currently written by the sender.
So we had the idea that the sender writes the file with an other extension
(.ie. tmp) and renames it afterwards.
That would work. But if SCP/SFPT or the OpenSSH we are using is working with
temp files so that a file (large and small files) will only appear in the
target folder when it is already completely uploaded it could not be
necessary to make anything special.
So the question is if OpenSSH ist working with temp-files or not?
Does anybody know something about that?
Re: How SCP/SFTP works
scp just writes to the file in-place and there's no easy way to change
it (short of modifying the code).
sftp also writes in place by default, but also supports rename operations.
You could implement the scheme described above with, eg, a sftp -b batch
file that does "put file.xml file.xml.tmp" then "rename file.xml.tmp
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
- » Is it possible to use libssh in properitary telnet
- — Previous thread in » Secure Shell Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum