login about faq

Can you provide instructions on using temporary filename prefix that is removed after the file has been successfully transferred and calculating digest of the original file and the transferred file?

asked Dec 24 '10 at 00:02

SSH%20KB's gravatar image


Prefix is useful, for example, in setups where the destination directory is polled for specific files and it must be ensured that processing of the file does not begin until it has been completely transferred. Also using the prefix helps to determine easily if the file has been only partially transferred, particularly on the server-side and with ascii file transfers. On client-side digests are recommended to be used to verify binary file transfers have completed successfully. Note that it is important the prefix used is chosen carefully as a file that already exists in the destination directory with the name "prefixfilename" will be overwritten during the file transfer and effectively removed. Following is an example of a simple file transfer setup from SSH Tectia Client host to Tectia Server host. This example assumes some form on non-interactive authentication has been already configured. The first file, sftp-commands.txt, contains the sftp commands which will change the remote directory, print the MD5 hash of a file in working directory on the client-side, upload the file to the server so that during the file transfer the file name in the destination directory is "tmp-file" and finally print the MD5 hash of the transferred file. Contents of sftp-commands.txt: cd relative_directory_to_user_HOME ldigest file put --prefix=tmp- file digest file quit For more information on the available sftpg3 options, please see the sftpg3 man pages. Second file, transfer.bat, will call sftpg3 in batch mode and use the sftp-commands.txt file for sftp commands. Contents of transfer.bat: sftpg3 -B sftp-commands.txt user@tectia_server_f_or_server_t

answered Dec 24 '10 at 00:06

Alan%20-%20Tectia%20Support's gravatar image

Alan - Tectia Support

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Dec 24 '10 at 00:02

Seen: 4,686 times

Last updated: Mar 04 '11 at 02:22

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.