ftp

ftp

Post by Les Smit » Sat, 17 Oct 1998 04:00:00



I need to transfer a file from a SCO box running 3.2.4.2 to another box
running HPUX10.20 every night. I know I can do it using ftp manually but
does anyone know how to automate this so I can use chron?
 
 
 

ftp

Post by Mark Wiewe » Sat, 17 Oct 1998 04:00:00


Include the following line in the file .netrc in the user's
homedirectory on the machine which is sending:

machine MACHINENAME login LOGINNAME password PASSWORD

Then write a short script like

ftp REMOTEMACHINENAME << eof
lcd LOCALDIRECTORY
cd REMOTEDIRECTORY
bin
prompt
put FILENAME
eof

You can now call this script via cron. Make sure you have configured the
login and password on the remotemachine correctly. This is for binary
transfer only, change bin to ascii is you need to do so. prompt switchs
off the interactive mode.

I hope that helps,
Mark
--
Mark Wiewel
System Administrator Unix
Legion Telekommunikation GmbH
Am Seestern 24
D-40547 Dsseldorf
Tel.: 0211-523 95 59
Fax:  0211-523 95 99


> I need to transfer a file from a SCO box running 3.2.4.2 to another box
> running HPUX10.20 every night. I know I can do it using ftp manually but
> does anyone know how to automate this so I can use chron?


 
 
 

ftp

Post by Les Smit » Sat, 17 Oct 1998 04:00:00


Thanks for your help Mark. I'll give it a try.

Include the following line in the file .netrc in the user's
homedirectory on the machine which is sending:

machine MACHINENAME login LOGINNAME password PASSWORD

Then write a short script like

ftp REMOTEMACHINENAME << eof
lcd LOCALDIRECTORY
cd REMOTEDIRECTORY
bin
prompt
put FILENAME
eof

You can now call this script via cron. Make sure you have configured the
login and password on the remotemachine correctly. This is for binary
transfer only, change bin to ascii is you need to do so. prompt switchs
off the interactive mode.

I hope that helps,
Mark
--
Mark Wiewel
System Administrator Unix
Legion Telekommunikation GmbH
Am Seestern 24
D-40547 Dsseldorf
Tel.: 0211-523 95 59
Fax:  0211-523 95 99


> I need to transfer a file from a SCO box running 3.2.4.2 to another box
> running HPUX10.20 every night. I know I can do it using ftp manually but
> does anyone know how to automate this so I can use chron?

 
 
 

ftp

Post by Bill Vermilli » Sat, 17 Oct 1998 04:00:00




Quote:>Include the following line in the file .netrc in the user's
>homedirectory on the machine which is sending:
...
>bin
>You can now call this script via cron. Make sure you have
>configured the login and password on the remotemachine correctly.
>This is for binary transfer only, change bin to ascii is you need
>to do so. prompt switchs off the interactive mode.

Binary works just fine for transfering ASCII text, however the
reverse is definately not true.  Always use binary and you should
have no problems.  I'm not aware of anything that won't transfer
under binary.

--

 
 
 

ftp

Post by Bitt Faul » Sat, 17 Oct 1998 04:00:00



> I need to transfer a file from a SCO box running 3.2.4.2 to another box
> running HPUX10.20 every night. I know I can do it using ftp manually but
> does anyone know how to automate this so I can use chron?

I prefer to use scp for such things.  If you make sure that all of your
host RSA keys are intact and you put the hostname in the correct users
.shosts file and you put the correct RSA key in that user's
~/.ssh/known_hosts file and you make sure that /etc/sshd_config is set
up to allow RSARhosts Authentication, you don't have to deal with
passwords.

http://www.ssh.org/
http://www.ssh.fi/
http://www.datafellows.com/

-Bitt

 
 
 

ftp

Post by Scott J. Showalte » Sat, 17 Oct 1998 04:00:00


|Binary works just fine for transferring ASCII text, however the
|reverse is definitely not true.  Always use binary and you should
|have no problems.  I'm not aware of anything that won't transfer
|under binary.

While this is true that binary will work for ascii files, it only works
properly if you are copying via ftp to a like OS. If you are transferring
files between DOS and UNIX or vice-versa via binary ftp, you will have
trouble with the carriage return - line feed problem. If you use ascii ftp
the file comes across just fine.

...Scott

The opinions are mine etc. etc. etc.

| Scott J. Showalter               | Komatsu Mining Systems, Inc.     |
| Manager Systems Administration   | 2300 N.E. Adams St., P.O. Box 240|

 
 
 

ftp

Post by Shane Y. Gibso » Sat, 17 Oct 1998 04:00:00



> I need to transfer a file from a SCO box running 3.2.4.2 to another box
> running HPUX10.20 every night. I know I can do it using ftp manually but
> does anyone know how to automate this so I can use chron?

There are 2 really good ways to do this...

        1.  use "ncftp"...it's got facilities built in
            for doing this stuff nicely, and automatically
            (http://www.ncftp.com./)

        B.  Use Secure Shell (ssh).  It has an "scp" program
            (secure copy) which is a really good alternative
            if you don't want to send your passwords across
            the wire in clear text (it uses public/private
            key encryption and encrypted data transfers).
            It also does NOT require you to have a password
            and account name in a text file that may potentially
            be compromised.  at:

                http://www.ssh.org/
                http://www.ssh.fi/
                http://www.datafellows.com/

v/r
Shane

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

               Monterey Bay Aquarium Research Institute

         "We need to understand that man belongs to Earth;
                and not that Earth belongs to man."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
 
 

ftp

Post by Frank Slootw » Sun, 18 Oct 1998 04:00:00


  The answer to your question is probably in ftp(1)'s "-i" and "-n"
options. A small example:

cd /where_you_want_it

user username password
binary
cd /where_it_is
get from_file to_file

 
 
 

ftp

Post by Bill Vermilli » Sun, 18 Oct 1998 04:00:00




>|Binary works just fine for transferring ASCII text, however the
>|reverse is definitely not true.  Always use binary and you should
>|have no problems.  I'm not aware of anything that won't transfer
>|under binary.

>While this is true that binary will work for ascii files, it only
>works properly if you are copying via ftp to a like OS. If you are
>transferring files between DOS and UNIX or vice-versa via binary
>ftp, you will have trouble with the carriage return - line feed
>problem. If you use ascii ftp the file comes across just fine.

I'd much rather have this trivial annoyance - as it's not a problem
- but if the default is binaray you can over-ride to ascii.  I've
seen many problems that were fixed by people setting binary first.

You mentioned  the CR/LF problem in the DOS <-> UNIX.  
Unix uses LF, MS uses CR/L, Apples uses CR.   However only a few of
the files I transfer into/from MS based systems are ASCII.

The biggest problems I've had was the MS idea (at least of the
programs I've had to import/export data for) was that fixed lengty
records have a record delimiter.  The whole concept of fixed length
was that you did not have to use a delimeter.  But so many of the
MS tools - either directly from MS or one that support MS -
can't cope with fixed record length files.  They insistt on a
record delimeter of they die.

I fought this on xfers from mainframe, via PC to my fixed record
length data base - on SCO and later Novell.

For the Mainframe/PC interface to work, all records in a fixed
length file added a record delimeter.  (This was in a secure area
as virually no pc's could reach that area of the MF).  Then
transfered from that itermine, back to the database, and having to
strip the added record delimeters.  

Of course this meant the exported file did not match in length the
original file - so additional checking had to be done to ensure
that the data was accurate.  Or and exact count of the original
number of records transfered would be multiplied by two, and that
number subtracted from the destination to see that it matched
the origination.

As you can tell, I like transparent transport - not transport that
defaults to what it thinks most people will use.

--

 
 
 

ftp

Post by George McConnel » Sun, 18 Oct 1998 04:00:00


% >I need to transfer a file from a SCO box running 3.2.4.2 to another box
% >running HPUX10.20 every night. I know I can do it using ftp manually but
% >does anyone know how to automate this so I can use chron?

do a man page on .netrc. preytty easy.

 
 
 

ftp

Post by Andrew Smallsha » Tue, 20 Oct 1998 04:00:00



> I'd much rather have this trivial annoyance - as it's not a problem
> - but if the default is binaray you can over-ride to ascii.  I've
> seen many problems that were fixed by people setting binary first.

> You mentioned  the CR/LF problem in the DOS <-> UNIX.
> Unix uses LF, MS uses CR/L, Apples uses CR.   However only a few of
> the files I transfer into/from MS based systems are ASCII.

I agree that binary should be the default type.  If you download using
ASCII when you meant to use binary, your only option is to download the
file again.  Downloading binary when you really meant ASCII, on the
other hand, is easily recoverable since there are many tools availiable
(included with all usable systems) to translate between the different
methods of storing text.

--
Andrew Smallshaw

 
 
 

ftp

Post by Milind A. Josh » Sun, 25 Oct 1998 04:00:00


Just write a ftp script...

create a .netrc file in your home directory with the format
machine <machine> login <login-name> password <passwd>

chmod 600 .netrc

then write a script...
ftp -i <machine> <<!
put xyz
!

chmod 700 ftp.sh

put ftp.sh in the crontab


> I need to transfer a file from a SCO box running 3.2.4.2 to another box
> running HPUX10.20 every night. I know I can do it using ftp manually but
> does anyone know how to automate this so I can use chron?

 
 
 

ftp

Post by Douglas Melnik » Tue, 27 Oct 1998 04:00:00


you can also, i think, use the 'scp' commane (secure shell copy) do a man scp
for details, but this allows you to copy a file to a remote host, putting all
the info (login/password/path) on the command line.

  - doug



>> Just write a ftp script...

>> create a .netrc file in your home directory with the format
>> machine <machine> login <login-name> password <passwd>

>> chmod 600 .netrc

>> then write a script...
>> ftp -i <machine> <<!
>> put xyz
>> !

>> chmod 700 ftp.sh

>> put ftp.sh in the crontab


>> > I need to transfer a file from a SCO box running 3.2.4.2 to another box
>> > running HPUX10.20 every night. I know I can do it using ftp manually but
>> > does anyone know how to automate this so I can use chron?

---------------------------------------------------------
Doug Melniker
Center for Connected Learning and Computer-Based Modeling
Tufts University
www.ccl.tufts.edu
 
 
 

1. Solaris ftp v Pro-ftp v WU-ftp

One-year newbie Solaris admin here. (And four yrs Linux experience extra,
does
that count extra credit?)

Management thinks they want an internet ftp server for the company.
Whatever,
they're mgt, and 'I serve at their pleasure'.. and paycheck. My questions:

1). why use a package like ProFTP or WU-ftp, instead of Solaris 2.6 ftp,
which
seems to me easy enough to use and cfg? (I'd ask them why, but that'd be
interpreted
as 'a bad thing'.)
2). which FTP is 'better'? I've heard of WU-ftp security holes, but am not
familiar
with Pro-FTP problems.
3). is there a better way to go?

I'm guessing this is for external customer browser convenience, which will
make me
RTFMs soon enough, yet any other comments, suggestions, or insights would be
appreciated. Thank you.

-fgz
(name alias and bogus email adrs to protect the guilty.)

2. pirate software for linux

3. FTP: New Linux FTP site: ftp.kernel.org

4. Putting the >current< command in the shell prompt.

5. Secure ftp, ftp over stunnel og ftp-ssl.

6. I hate Linus Torvalds, revisted

7. How to connect to an FTP through an FTP-Proxy.

8. Lost Standard Error Problem

9. Can't ftp to Linux box from windows ftp client

10. make a character device /dev/ftp that do ftp

11. Problems with FTP (wu.ftp) HELP!

12. FTP: Looking for source code for FTP client program

13. how do I use the cern ftp proxy with non web ftp clients?