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....
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.
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
It transfers files recursively from the directory src to machine "foo" the destination directory being dest/
it transfers file in archive mode, preserves symbolic links,attributes,permissions,ownerships and compressions etc.
Thanks for replying gaurav. rsync looks like it can be verify useful, but my requirements are to use FTP. Source is Solaris and destination is Windows with no shell environment. Automation is the other requirement that I fail to mention.
I need to have script that generates an ftp script, that "cd" and mkdir as stated in previous post.
There are openssh versions for windows. You can then employ rsync for the destination as windows boxes. As per automation, rsync is "the best" option . You can distribute the public key on the server(windows) and easily automate the procedure through a bash/perl script over a cron job in solaris.
The part I am having trouble with is the part that tracks each directory. The master script must track the directory path in order for it to generate the "ftpscript.sh" as seen above. The master script (and not the ftpscript.sh) will read each of the directory paths and generate the ftpscript.sh above.
Hope that is clearer. Thanks your your suggestions!!!!