SUMMARY: Unattended FTP

From: Vern Walls (Vern.Walls@parsons.com)
Date: Tue Sep 05 2000 - 15:26:03 CDT


First, THANKS!!! for all the quick responses, I got it to work just fine.

Specifically, deep felt gratitude is extended to:
Andrew Sit
Buddy Lumpkin
Sanjaya Srivastava
Frank Velaquez
Frank Smith
Tim Fritz
James Zhao
Amit Mohan
Samir Sethi

plus a "Gee, Thanks for nothing" to the two un-named individuals who took the time out of their busy day to tell me to look at the man page for "netrc" (like I hadn't thought of that and was still stumped...)

Anyway, the original problem was:

      Does anyone have the time to show me how to set things up so that
      I can have root's (or anyone else's) crontab extract a couple of
      files from another server back onto the one initiating the transfer?

      For example, how would I set it up to extract copies of the files
      named "/temp/file1" and "/temp/file2" from the remote server named
      "system1" using a user ID of "oracle" with a password on the both
      systems of "ora-pass"? The UID is the same on both systems for the
      user "oracle".

THE SOLUTION: (at least the one I used)
======================================

LINE IN ".netrc" (which must be mode 600 in initiating users $HOME:
machine system1 login root password root-pas

THE ACTUAL SCRIPT RUN FROM CRON:
===============================
#!/bin/sh
ftp system1 << !EOF
binary
cd /remote/system/source/directory1
cd /local/system/target/directory1
get file1a
get file1b
cd /remote/system/source/directory2
cd /local/system/target/directory2
get file2
cd /remote/system/source/directory3
cd /local/system/target/directory3
get file3
bye

!EOF
#END OF THE SCRIPT

NOTE --- a couple of responses mentioned that the blank line after the:
bye
and before the:
!EOF
was **REQUIRED**. Since it was stated more than once I saw no need to verify that. I used the blank line and it worked fine.

Have a Great Day, and, again, THANKS for all the QUICK assistance provided!!

                                Vern Walls
                                Perot Systems

THOUGHT FOR THE DAY:
===================
Light travels faster than sound.
This is why some people appear bright
until you hear them speak.

S
U BEFORE POSTING please READ the FAQ located at
N ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq
. and the list POLICY statement located at
M ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/policy
A To submit questions/summaries to this list send your email message to:
N sun-managers@ececs.uc.edu
A To unsubscribe from this list please send an email message to:
G majordomo@sunmanagers.ececs.uc.edu
E and in the BODY type:
R unsubscribe sun-managers
S Or
. unsubscribe sun-managers original@subscription.address
L To view an archive of this list please visit:
I http://www.latech.edu/sunman.html
S
T



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:16 CDT