Sponsored Content
Top Forums Shell Programming and Scripting Recursive Replication of Unix folders to Windows Post 302413835 by mlv_99 on Saturday 17th of April 2010 02:21:45 PM
Old 04-17-2010
Recursive Replication of Unix folders to Windows

Requirements: ftp files recursively from unix to windows. Replicate
directory paths on unix (source) to windows (destination) and place
files in their respective folders. There are no set number of files per
directory nor fix number of dirA or dirB etc....

Code:
Source OS:        Solaris 10
Source Dir:        
             /dir1/dir2/dirA/file1
             /dir1/dir2/dirA/file2
             /dir1/dir2/dirA/file3
         
             /dir1/dir2/dirB/file1
                 
             /dir1/dir2/dirC/file1
             /dir1/dir2/dirC/file2
 
             ....
        
         
 Destination OS:    Windows 200?
 Destination Dir:    
             /dir1/dir2/dirA/file1
             /dir1/dir2/dirA/file2
             /dir1/dir2/dirA/file3
         
             /dir1/dir2/dirB/file1
                 
             /dir1/dir2/dirC/file1
             /dir1/dir2/dirC/file2
 
             ....

Not sure if this is the best approach this requirement. I would like to have a script that will dynamically create an ftp script to support the above requirements.
Code:
 open HOST
 quote USER _USER
 quote PASS _PASSWORD
  binary

 mkdir dir1
 cd dir1
 mkdir dir2
 cd dir2
 mkdir dirA dirB dirC


 lcd /dir1/dir2/dirA
 cd dir1\dir2\dirA
 mput file*

 lcd /dir1/dir2/dirB
 cd dir1\dir2\dirB
 mput file*

 lcd /dir1/dir2/dirC
 cd dir1\dir2\dirC
 mput file*

 etc....

 bye


Thank you.
mlv_99

Last edited by Scott; 04-17-2010 at 07:26 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix System Total Replication

Is there any way to totally replicate a unix system from one hardisk to another? And be able to swap the hardisk and restart the system without any error? TQ (4 Replies)
Discussion started by: nuraman
4 Replies

2. HP-UX

HP Unix replication solution

Hi, I looking to setup HP Unix to HP Unix replication as plan of business continuity. The setup can be active passive or active active. Anyone can give me some idea what solution able to perform that? Thanks (3 Replies)
Discussion started by: ufo_999
3 Replies

3. UNIX for Dummies Questions & Answers

folder replication between windows and unix

1. How do i replicate folders between windows and unix. if i create a subfolder under NDC in windows, it should automatically create a subfolder in unix as well. windows nt /NDC/SUBFOLDERS hp ux /NDC/SUBFOLDERS 2. How do i ftp a file from windows to unix using automated... (0 Replies)
Discussion started by: systemsb
0 Replies

4. Windows & DOS: Issues & Discussions

Copy folders and subfolders from unix to windows

Sir From a unix machine some folders and their folders have to be copied to windows XP PC. Please help me with a batch file or a shell script. I am new to the the shell and batch files. Thanks in anticipation. sastry (3 Replies)
Discussion started by: chssastry
3 Replies

5. UNIX for Dummies Questions & Answers

Renaming file in Recursive folders

I have UWin version of Unix for Destop I have files with extension *.abc. I want to rename it to *.csv. Some of the filenames have spaces. I also to rename the files with extension *.abc in the corresponding subfolders ex == abc def.abc ghi jkl.abc mnopqr.abc uvwxyz.abc rename as... (4 Replies)
Discussion started by: bobbygsk
4 Replies

6. Windows & DOS: Issues & Discussions

Windows mass copy files with same name in differnt folders

I have files existing with same names in the folders with date as display below c:\2010-09-10 <==== folder arr1.jpg arr2.jpg arr3.jpg arr4.jpg c:\2010-09-09 <==== folder arr1.jpg arr2.jpg c:\2010-09-08 <==== folder arr2.jpg arr3.jpg arr4.jpg ... (5 Replies)
Discussion started by: jville
5 Replies

7. Shell Programming and Scripting

recursive saving of files and folders

Hi all I have a bash script, that loops through a folders files and all subfolders for .shtml files. It looks for a string and replaces it, creating a backup of the original file. This all works great, but I'd like, when the backup is done, that the files are then also created in their... (4 Replies)
Discussion started by: terrid
4 Replies

8. Shell Programming and Scripting

Help to move folders, subfolders and files from unix to windows

Hi Unix Gurus, I am able to copy only files that exist in the parent folder. My parent folder has sub folders and within sub folders there are lots files. I need to copy folder, sub folders and files from Unix to the remote windows SFTP location. The directory structure is something like... (1 Reply)
Discussion started by: shankar1dada
1 Replies

9. HP-UX

Recursive copy of Folders with files

Dear All, I will appreciate any help received. Our system is running on hpux v1 My problem is as follows: We have many customer folders with name fd000100, fd000101 and so on e.g. (Testrun)(testsqa):/>ll /TESTrun/fd000100 total 48 drwxrwx--- 2 fq000100 test 96 Jun 27 2004... (17 Replies)
Discussion started by: mhbd
17 Replies

10. Shell Programming and Scripting

[Perl] Module for recursive listing of remote Windows shares

Hi, I'm looking for a Perl module which can recursively list remote Windows shares from within a Linux machine. I've tried Filesys::SmbClient ans Filesys:SmbClientPars but they just list the current directory Thank You for your help (4 Replies)
Discussion started by: Fundix
4 Replies
All times are GMT -4. The time now is 04:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy