Operating System - HP-UX
1834137 Members
2281 Online
110064 Solutions
New Discussion

FTP script from Unix to Windows.

 
Chirag Parekh
Advisor

FTP script from Unix to Windows.

Hi,

I need to write a script on Unix that ftp's files from a Windows server and deletes the files on the Windows server. How can I accomplish that? Also I want to check whether the files were ftp'ed correctly before I delete them from the windows server. Currently I am using the below script to transfer the files from the Windows server.

ftp -nv << EOF
user
bin
mget *
quit
EOF
4 REPLIES 4
Bill Hassell
Honored Contributor

Re: FTP script from Unix to Windows.

You can push or pull the files in a script on the HP-UX side, but validating the data is going to be difficult. There are no commands in ftp to compare files. Now you could use the dir command in your script to display the size of the Windows files, capture that data as stdout from your script and then check the HP-UX files and compare the results.


Bill Hassell, sysadmin
Devesh Pant_1
Esteemed Contributor

Re: FTP script from Unix to Windows.

Did you consider CIFS as an option and that will let you map an HP-UX filesystem on to the windows side where the file may get created and on the same filesystme you can have all your file manipulation/deletion scripts on the UX side.

Devesh
Eknath
Trusted Contributor

Re: FTP script from Unix to Windows.

Hi Chirag,

You can configure samba on Unix server and then you can map unix fileystems on windows. Then a scheduler can be created on windows for coping the files. But security is a concern here.

secondly,
you can have a batch file on windows whcih will use windows ftp. e.g ftp -s:filename
where in filename you can specify the ftp commands.

Cheers!!!
eknath
Cem Tugrul
Esteemed Contributor

Re: FTP script from Unix to Windows.

Hi Chiraq,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=887303
Our greatest duty in this life is to help others. And please, if you can't