[Sunhelp] Automated FTP

afrose abdulla afrose at millenniumit.com
Mon Sep 20 03:41:07 CDT 1999


Rose,

To automate an FTP login:

                      1. Create the file $HOME/.netrc
                      2. The format of this file is (an example):

                              machine <machine_name> login <user_name>
password <passwd> macdef init
                              cd /home/<username>
                              put <local_file> <remote_file>

                         The lines following the macdef <mac_name> are the
code for the macro.
                         Macros in the $HOME/.netrc file will execute a list
of commands specified.

                      3. NOTE:

                         ***This file must have read access only for the owner
if the passwd is
                            included.

                              chmod 600 $HOME/.netrc

                         ***For the macro to be executed upon login it must be
named init.
                            Otherwise, if you use a name other than init you
can use the $ to
                            run the macro during an ftp session.

                              ftp>$macroname


                      4. For more information see the man page for netrc

Make sure you've done this, and then reffer to what Clayton had mentioned
below. Bascially execute your script as the same user. That users $HOME
directory should contain the .netrc. Hope it works.
Cheers
afrose


Clayton Winter wrote:

> A shell script run by cron would do it.
>
> Your ftp client has a user command **account [passwd]*** so if the script
> was run by a valid user you could login from a shell or perl script.
>
> The rest would be fiddling about.
>
> Regards
> Clayton
>
> -----Original Message-----
> From: sunhelp-admin at sunhelp.org [mailto:sunhelp-admin at sunhelp.org]On
> Behalf Of Duncan, Rosemarie A
> Sent: Wednesday, 20 September 2000 8:24 AM
> To: 'sunhelp at sunhelp.org'
> Subject: [Sunhelp] Automated FTP
>
> Hi,
>      I would like to schedule a nightly FTP.  Is there a way of doing this
> wihout using anonymous ftp?
>
> Thanks,
> Rose Duncan
> voice 805.982.2570, DSN 551 fax 805.982.2659
> Navfac Information Technology Center (NITC)
>
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp
>
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp






More information about the SunHELP mailing list