: Hi,
: I have two networked machines running unix (one SunOS, one Irix), that I'd
: like to write a script that, daily, will automatically (from one to the
: other), ftp in, change to a certain directory, get a text file and save it
: in a certain directory and log out.
Try this -- create a file called .netrc in your home directory with
contents something like this:
machine xyz login userabc password userpass macdef init
cd ...
get ...
...
...
bye
Then when you type 'ftp xyz', it will automatically log in to the
system 'xyz', as user 'userabc' with password 'userpass' and
execute the commands below it. Oh, you must leave a blank line
after the 'bye' so it knows that it's done. You can 'man ftp' or
'man netrc' for more details.
: The file is a log file, and the date will change everyday, so the script
: needs to be smart enough to look for yesterday's date.
You need to use cron on you local machine to get run a script. The
script should get the current date, subtract 1 from it (I believe
that the 'date' command has the capability to do this), append it
to whatever else to generate the name of the file to be transferred,
and have the script write the .netrc file at that time with the
required filename, etc. Then it should do the ftp command.
: is this at all possible?? i have no exp. doing these things, so if it is
: possible, how could i do it, what to do it in, etc.
It is possible -- I'm using something like this to do backups
for a system with a dead tape drive where the tape drive costs
more than the system is currently worth.
: any and all help appreciated
: tia,
: jonathan
-Neil.
--
----------------------------------------------------------------------.
| http://cessna.med.miami.edu/~cobra/Anil.html |
`----------------------------------------------------------------------'