On Thursday 28 August 2003 11:44 am, Timothy Brown wrote:
> I am resending this for the 3rd time becasue it doens't look like it
> ever made the list.
> List,
>   I need to know how to write a shell script that ftps a couple of
> files up each day.  Any one have any ideas?
> Tim

This should help you get started.  Just modify the following to suit 
your needs and run it from a cron job.

#!/bin/bash
ftp -n -v <ftpserveradress> << EOF
user <username> <password>
binary                            # or ascii
cd <remotedir>
mget <filename>           # or mput
quit
EOF

Be warned that the password is stored in plain text in this script, so 
if you're not connecting to an anonymous ftp server, you put your 
password at risk using this method.  If you need a secure transfer, man 
sftp. It allows a batch file that contains the commands (similar to the 
above) and can be run non-interactively.

-- 
Thomas K. Gamble
Los Alamos National Laboratory
Advanced Diagnostics & Instrumentation (C-ADI)
p:505-665-4323 f:505-665-4267
MS-E543


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to