LFTP is also neat ftp client.
Main Topics
Browse All TopicsI have problem on automate the FTP using unix shell. Could anyone help?
Regards,
William
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
ahoffman's suggestion is a good bet, but he didn't mention the ncftpget/ncftpput utilities that are intended for scripted ftp transfers, check out www.ncftp.com.
You can create shell scripts to transfer files (and entire directory trees) and within the script even detect transfer success, something like:
#!/bin/sh
#
cd incoming
ncftpget -u user -p password ftp.dom . /pub/some-file
if [ $? != 0 ]; then
echo "Transfer failed"
fi
you CAN automate ftp with the unix shell, all you need is a .netrc file which will conatin the info for each server you want to connect to.
IE
machine place.you.connect.to
login USERIDGoesHere
password PasswordGoesHere
macdef init
Insert any FTP commands you want to run in here
bye
Then in your crontab place the command ftp -i ServerName at the appropriate time.
Hope that helps
YES YES it can be automated, that is why the rights to netrc need to be set as I stated in the follow up. (A portion of man ftp follows)
OPTIONS
The following options may be specified at the command line,
or to the command interpreter:
-d Enable debugging.
-g Disable filename "globbing."
-i Turn off interactive prompting during multiple file
transfers.
-n Do not attempt "auto-login" upon initial connection.
If auto-login is not disabled, ftp checks the .netrc
file in the user's home directory for an entry describ-
ing an account on the remote machine. If no entry
exists, ftp will prompt for the login name of the
account on the remote machine (the default is the login
name on the local machine), and, if necessary, prompts
for a password and an account with which to login.
--More--(5%)
This is referring to /usr/ucb/ftp on Solaris (and every other UNIX I have ever used) if the rights are not set correctly on .netrc then the command will fail but if they are set it works like a charm (I use it for a LOT of automated Transfers)
yes, on Solaris, FreeBSD and Linux (all BSD-like ftp clients)
Always thought that ftp did it like telnet/login: read from tty directly, but something
seems to be different, 'cause your solution works.
But requires very new ftp clients, which understand the quote command, without it, it does nott work.
Business Accounts
Answer for Membership
by: ahoffmannPosted on 2000-02-09 at 23:06:33ID: 2506699
standard ftp clients cannot be automated, at least passwords must be passed interactive
You may try ncftp, which has a .ncftp file.