[Sunhelp] Automated FTP

P Nutton Paul.Nutton at awe.co.uk
Wed Sep 20 09:03:56 CDT 2000


I use the following script that I picked up off a sysadmin newsgroup far too
long ago.
Edit and change HOST, USID and PASSWORD as required (USID also appears in
the mail notification bit)

Enjoy.

Paul Nutton

#!/bin/sh

# The following script gets all files on HOST using usid USID and password
PASSWORD,
# using the "ftp" operation of "mget".


	BACKUP=${HOME}/backup
	date>${BACKUP}/backup.log 2>&1
        cd $BACKUP
	(
        echo "
        open HOST
        user USID PASSWORD
	  bin
	  prompt
	  mget *
        close
        "
        )  | ftp -i -n -v 1>>${BACKUP}/backup.log 2>&1
        

# The "ftp -i" option disables the interactive prompting that would
# normally occur with a multiple file operation.  The "-n" disables the
# auto-login function.  The -v option asks for verbose output, ie informs
# of all actions.  If you trust your own security then you can enter your
# password after the usid (seperated by a space).


        # /usr/ucb/mail equiv to mailx, -s sets subject
        /usr/ucb/mail -s'backup completed' USID<${BACKUP}/backup.log
        exit

> -----Original Message-----
> From:	sunhelp-request at sunhelp.org [SMTP:sunhelp-request at sunhelp.org]
> Sent:	20 September 2000 10:45
> To:	sunhelp at sunhelp.org
> Subject:	SunHELP digest, Vol 1 #569 - 19 msgs
> 
> From: Duncan, Rosemarie A [mailto:DuncanRA at nitc.navfac.navy.mil]
> Sent: Tuesday, September 19, 2000 5:24 PM
> 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
> 
--
_______________________________________________________________________________

The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited.  Please notify us immediately by email at intadmin at awe.co.uk, and then delete this message from your computer.  While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected.





More information about the SunHELP mailing list