Let us assume the file name on UNIX is abc. I have to copy this to the directory in windows I need the shell script after my session completes to copy output file in to windows specified path. Could you please help me? Your problem is that you ought to protect the Windows system security, but you would need to embed some password in a Unix script, or set up ssh key pairs or similar. You need a protocol that Unix and Windows share that is, both systems understand it. Most usually FTP, but perhaps also ssh.
Be aware that ftp clients have a large variation in the expected options. Also, if the Unix is initiating the transfer, then it does so as the Client. My personal preference for simplicity is to use ssh for a transfer. The local ssh just reads the file through redirection, and the quoted cat command gets run on the remote system.
Whoops — cat is a UNIX command. You might need to change this to "copy" for a Windows box. We use it in shellscript since years. But, the thing is I need the shell script after my session completes to copy output file in to windows specified path. I think the last six posters have ignored the stated problem. So, just going into the Windows box manually when you think the file is ready to fetch, and initiating any kind of operation manually, is not a solution. So Samba and other NFS-type solutions might not be feasible for security reasons also.
Thanks for all of you. I need to automate it by writing a script and calling it every day after session completes successfully. Anyone can give the exact shell script to do this functionality?
You need to have WinSCP installed on your windows client and use windows schedule and the command described in the link above to automate the process.
Add IP address in UNC path: although that is not state-of-the-art, it works correctly on the "other" side, Windows would rise a security risk by accessing a UNC path containing an IP address of course.
Add the urgency from swarna in a following mail: sorry, but I understand this forum as a medium to get tips and hints, but not to expect a ready solution without any costs. If you can get the Windows team to install a ssh server on the Windows server, then I would suggest this is the way to go. As FTP is not a secure form of transport, you can ask the Windows team to make a virtual directory to the required "output" directory. The FTP server and the "output" directory do not even need to be on the same host.
An additional advantage of a virtual directory is that it does not show in the root directory listing, but can still be accessed.
You should probably ask the Windows team to set the directory view as UNIX-style; but if they decide to leave it as DOS-style, then it can be changed on the fly using the "quote site dirstyle" command. To set this up in AIX is less than 5 minutes work. Thanks for the great comments.
And the issue is I have to re-direct the file into the windows machine from UNIX machine and update the latest file which should be placed in the directory. I mean, the previous day the file should be replaced by nextday file everyday. But, the file name should not be changed. Even I am having the same requirement, to copy files from Windows to Unix box.
I did read the above links, but they all require manually intervention which we want to avoid. We want something which we can schedule and it should get kick based on completion of dependency and copy the files. I can say this about Samba, maybe winscp is the same: After configuring and starting the server, then there is no more manual intervention.
If you want to try another ftp software, give a shot to WinSCP. If you want to send files from your unix server to your desktop, then you can use Winscp. It is an application in windows. Install it, open the app, enter the IP,username,password of your unix server and you can easliy transfer files between your unix server amd your desktop. Then add a space and the location to which you want to copy the file. The default port that our containers use is Basically, use ftp. So you'd do ftp. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related
0コメント