Secure transfer between Windows and UnixHey Middleware Admin fans, here I am going to discuss about secure transfer for data/files between Windows and Unix systems. There are many ways to do this task. On your Windows desktop you can simply open SSH window and click on Yellow icon on top that had tag line as "New File Transfer Window" authenticate and ftp/copying thats all done! You have specific tools that enables you to transfer of files from Unix to Windows or vice versa, such tools are winSCP, psftp, pscp etc.
Scope for AutomationThe task is repeatative then you will choose automation scripting with batch processing. After executing the automation job you must be be able to do secure transfer of There are server GNU opensourced utility tools are available to do this complex task.
1. WinSCP portables 2. PSFTP or pscp Using WinSCP portablesUsually if you wish to do this task for single file and one time task nothing matter. The middleware secret here is
Your task would be either put or get files between Windows and UNIX boxes. To do this task you will be performing the following steps: 1. While doing ftp you need to open the session between Windows box to UNIX box. Utility tools can be downloadable from WinSCP must available in the environment the directory path must be in PATH variable. setenv.bat set datevar=%date:~10,4%_%date:~4,2%_%date:~7,2% set log_file=C:\testlocation\log\myscript_%datevar%.log Here in the above batch script you can have your own definitions for the installation paths and script paths.
Now let us see the filetransfer.txt contains the winScp file transfer logic(ftp commands) in the following script:
# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on # Disable overwrite confirmations that conflict with the previous option confirm off # Connect using a password open user@Unixhostname.com # Change remote directory cd /unix/remote/location/ # Force binary mode transfer optional option transfer binary # Download file to the local directory get *.doc C:\testlocation\ # Disconnect ftp session close # Exit WinSCP batch script exit Now its time to run your WinScp script it takes few options in the command line as given below:
%winscp_exe% /console /log=%winscp_log% /script=%winscp_script_file%
Using psftp utility
|
UNIX >