Visit Our UNIX and Linux User Community


Unix shell script to Copy files from one Windows server to another Windows server.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix shell script to Copy files from one Windows server to another Windows server.
# 1  
Old 10-20-2011
Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement:

I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell script will be scheduled in Informatica to run every 10 mins such that all the files will be copied between the two windows servers for their respective folders.

I will get the source path(one windows server) and target path (another windows server) in a text file as below:


MailAssurety\Baraboo\BRN-000001,MailAssurety\Jobs\Read\BRN-000001
MailAssurety\Liberty\BRN-694269,MailAssurety\Jobs\Read\BRN-694269
MailAssurety\MapGrove\BRN-884432,MailAssurety\Jobs\Read\BRN-884432

Can anyone please help me with the unix script for this requirement ?
Thank you in advance for helping out.
# 2  
Old 10-20-2011
There's a lot more involved in connecting to a Windows file share than a shell script. It's more like mounting an external disk or filesystem than copying to FTP.

How to do so depends what your system is. Your OS, not your application.

Are these Windows machines running scp, ftp, or anything like that?
# 3  
Old 10-25-2011
Unix shell script to Copy files from one Windows server to another Windows server.

No.. The windows machines are not running any programs like SCP, FTP etc...
# 4  
Old 10-26-2011
If you have smbclient available you could pipe tar output from one instance to tar extract in another something like:

Code:
smbclient //boldls-mwe-dev4/MailAssurety -T c - Baraboo/BRN-000001 | smbclient //rrwin-ewhd04.ecomad.int/MailAssurety -D Jobs/Read -T x -

# 5  
Old 10-26-2011
I'd use Windows Services for Unix, this package is included in Windows 2008 and later, or download it from MS, search for SUA. For W'2003 and older look for SFU 3.5. Both are pretty stable. There is a great net community that supports it here:
SUA Community: Microsoft Windows Subsystem for Unix-based Applications, Interix and SFU

Previous Thread | Next Thread
Test Your Knowledge in Computers #17
Difficulty: Easy
Microsoft first developed the Java programming language.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

2. Solaris

FTP-ing files from Windows server to UNIX server

I need to transfer files from a Windows server to the Unix server and have to run some shell script on it to get the required output. Is it possible to transfer files from Windows server to unix server through any shell script? If so can you please help me with the details. Thanks in... (8 Replies)
Discussion started by: ssk250
8 Replies

3. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

4. UNIX for Dummies Questions & Answers

Copy files from Linux server local windows machine using a shell script

Hello, I need to create a shell script which will copy files - which are created on particular date and starting with particular name - to local windows XP machine. Is this possible.? Currently it is being done manually using winscp (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies

5. Shell Programming and Scripting

Copy files from Linux server to Windows server

Hi All, I am generating report in a Linux server and once the report is generated the report(.txt file) needs to be automatically saved in a Windows servers. So i am looking for a script to transfer the file automatically from Linux server to Windows server? Please advise. Thanks... (3 Replies)
Discussion started by: arunmanas
3 Replies

6. Shell Programming and Scripting

Need Shell Script to copy files from hp UNIX to windows server 2008

Need Shell Script to copy files from hp unix to windows server 2008 I tried to google and found some options but nothing worked I want a script to copy a file in unix to windows server so I can schedule the script on daily basis.Please help me its more needful for me. Let me know if any... (4 Replies)
Discussion started by: Lucky2Bv
4 Replies

7. Shell Programming and Scripting

Unix shell script to delete files on windows server

Hi experts, can anyone suggest me on the below: how to write a shell script to search and delete files on windows server. -script runs on unix box -it should search for specific files on windows server and delete them periodically. (2 Replies)
Discussion started by: chpradeepch
2 Replies

8. Shell Programming and Scripting

Copy a directory from a server (UNIX) to a PC (Windows)

Hello, I already do some question about this topic. I already establish the conection from the server (Centus) whit the windows PC using SSH. Now I have two problems: 1- The server always ask me about a password to copy the files to the windows pc, I don't know how to avoid this, if someone can... (2 Replies)
Discussion started by: yeestrada
2 Replies

9. Shell Programming and Scripting

shell script to ftp the files from windows to unix server

Hi, I need to ftp some input files from windows to unix server.All the files will be saved in the C drive in my machine. Currently all these files are transferring manually to the unix server.I need to write a shell script which ftp the files from windows to unix box.When I searched in the... (10 Replies)
Discussion started by: kavithakuttyk
10 Replies

Featured Tech Videos