Gidday all,
I would like to thank the 34 people who sent a reply.
Information ranged from "Check .netrc in the man pages" to complete scripts
in both shell and perl.
In essence; The answer is yes it is possible and here's how;
1.) Using a script of the form;
ftp -n -v << EOF > .ftplog
open $HOST
user $USER $PASSWORD
ascii
put $file $sendfile
quit
EOF
grep -q "226 Transfer complete." .ftplog
sentok=$?
Here the EOF is a flag which is called at the end of the ftp script to
complete the ftp component
2.) Use the expect package;
http://expect.nist.gov/
3.) Use ncftp;
http://www.ncftp.com
This has some nice command line capabilities.
4.) Use perl and the nettools module from CSPAN (
http://www.cpan.org/) and
the following sort of construct;
#!/usr/local/bin/perl
use Net::FTP;
$ftp = Net::FTP->new("some.host.name");
$ftp->login("joe","bob");
$ftp->cwd("/pub");
$ftp->get("that.file");
$ftp->quit;
This provides excellent monitoring of the status of the transfer.
5.) or simply put the components in a file and suck it into ftp;
The file will look like:
user anonymous someone_at_company.com
cd /in_files/dir1
binary
prompt
mput *.jpg
quit
It can then be used in the following way:
ftp -n remote_machine < ftp_commands
6.) Use wget from GNU. Unfortunately this only retrieves. We need to send.
I have tried none of these as yet but favour standard ftp script as a first
(emergency) fix. Perhaps one day I will clean it up and make it really sing.
The following people provided information and their expertise;
Hasan Atasoy [HAtasoy_at_ifk.com.tr],
Gavin Kreuiter [gavin_at_transactive.usko.com],
Antonio Urbano [a.urbano_at_lycos.com],
Knut Hellebų [Knut.Hellebo_at_nho.hydro.com],
Michael Whittaker (QDT) [Michael.Whittaker_at_edt.ericsson.se],
Nikola Milutinovic [Nikola.Milutinovic_at_ev.co.yu],
Chewy [chewy_at_slamon.com],
Peter.Stern_at_weizmann.ac.il,
jean.schuller [Jean.Schuller_at_IReS.in2p3.fr],
Freesmeyer, Mary [mfreesmeyer_at_cvty.com],
M selcukkaraca [selcuk.karaca_at_aski.gov.tr],
Dmitry Makhrov [dmakhrov_at_crystal.kz],
Michael James Bradford [mjbr_at_tdk.dk],
Matt White [whitem_at_bofh.usask.ca],
Ann Cantelow [cantelow_at_atlas.csd.net],
nikhil [nikhilnews_at_myiris.com],
David Henden [david.henden_at_domain.se],
Oyanarte Portilho [portilho_at_helium.fis.unb.br],
Roetman, Paul [PRoetman_at_CSXLines.com],
Bochnik, William J [BochnikWJ_at_bernstein.com],
Bruce B. Platt [bbp_at_comport.com],
Jim Fitzmaurice [jpfitz_at_fnal.gov],
Dyer, Steve J. [Steve.Dyer_at_alcoa.com],
Jim Belonis [belonis_at_dirac.phys.washington.edu],
Davis, Alan [Davis_at_tessco.com],
George Gallen [ggallen_at_slackinc.com],
system administration account [sysadmin_at_astro.su.se],
Larye D. Parkins [larye_at_selway.umt.edu],
Evans, William [Bill.C.Evans_at_wcom.com],
Balfour, Scott (Eurosoft) [scott.balfour-eds_at_eds.com],
Serguei Patchkovskii [patchkov_at_ucalgary.ca],
Thomas M. Payerle [payerle_at_physics.umd.edu],
Tom Webster [webster_at_SSDPDC.LGB.CAL.BOEING.COM]
Thanks
Wayne Blom
System Specialist
Technical Development Healthcare
F H Faulding & Co Limited
Ground Floor
1 Station St
Hindmarsh SA 5007
Ph: +61 8 8241 8334
FAX: +61 8 8241 8357
Mobile: +61 0419 808 496
Email: wayne.blom_at_au.faulding.com
Received on Thu Aug 17 2000 - 00:11:45 NZST