Automate tranfer of file from unix system to windows.

June 26, 2012 at 08:00:56
Specs: Windows XP
Automate tranfer of file from unix system to windows.

I need to automate tranfer of file from root directory of unix system to xyz directory of windows system.
I wish to perform the activity through some scheduled job at windows system.
What all things i need to have or install in the systems?
Any help would be greatly appreciated

See More: Automate tranfer of file from unix system to windows.

Report •

June 26, 2012 at 08:05:51
Use the rsync utility.

Report •

June 26, 2012 at 08:19:15
It depends upon what facilities you have available on the Unix system, what you are able to install, and whether you want to keep back copies of the file or just want to keep it synchronized with the Unix system. Just saying "Unix system" is a bit vague.

In the latter case, if rsync is available, it's a good choice. But if you want to keep multiple copies of the file it may be better to write a batch script that transfers the file daily using FTP or SMB. Both of those depend upon you having the appropriate software running on the Unix system. NFS may be a better choice, again if it is available to you.

Report •

June 26, 2012 at 09:01:25
Thanks ijack for the response.

Actually the unix system is a DB server having the OS-Unix.
My dump file (.dmp) will be generated around once in a week at the root directory of this DB server.

Can you help me writing a batch script in the windows system which can access the unix system and transfer the file to it.

Since the Unix system is a server, we dont have many options for performing installations at that end but can install required components at Windows system.

Also please share what all components need to be installed in each system for this acitivity.

I dont have much idea about these, hence any quick help would be greatly appreciated.

Report •

Related Solutions

June 26, 2012 at 09:57:53
Your first step is to talk with the sysadmins of the UNIX system to find out what type of connections they allow.

Most sysadmins will disable ftp access for security reasons and require all connections to be made over a secure ssh channel. If that's the case, then you'll want to use either rsync or scp and setup the public/private ssh keys.

Some admins setup samba shares which allow you to map a drive to it and use the Window's copy command to get the file.

If their security is more relaxed, you could use wget or as a last resort ftp to get the file.

Report •

June 26, 2012 at 10:28:14
I've done something similar in the past using plink.exe which called a shell script on the Unix system to PUT a file using FTP to a Windows based FTP server.

May be another option if adding services to the Unix host isn't an option.


Report •

June 26, 2012 at 11:29:10
FishMonger is quite correct. Your first step is to talk to the people who look after the Unix system to see what transfer mechanisms are available. Only then can you pick the best one for your purpose. It may even be that, if you speak nicely to them, they can set up a job to push the information to your system.

Report •

June 26, 2012 at 12:16:48
On the windows side, task scheduling is handled by the command "at" (see: at /?)
and Unix does the same thing with the same command. netcat is another windows option ( and is a good learning/experimentation tool. It can connect to any listening tcp/ip port.

Report •

June 26, 2012 at 21:02:27
Thanks ijack and FishMonger for your valuable inputs
I am discussing the requirement with the unix system administrators.

Meanwhile, i am utilising this time creating a shell script which i think can be added to a cron job if agreed by the unix system administrators.

Shell Script:

quote USER $USER
put $FILE
exit 0

the above script is working fine and the .dmp files are getting moved to the home directory of the apache server installed in target Windows system.

Can you pl help me in writing the logic in above script for:
1) If any .dmp file is successfully found in the location and successfully transferred, shoot a mail to few mail ids about it. A mail also needs to be sent in case no file is found and a mail also needs to be sent in case file was found but could not be successfully transferred.
2) generate logs with date in the folder.

Thanks in advance.

Report •

June 27, 2012 at 06:47:14
Sorry, I'm not good at shell scripting, but if you want to use Perl, I can help with that script.

Report •

Ask Question