Hello,
I'm sure this is an easy one for you UNIX pros. I would like to create and and automated an FTP process. The script should do this:
Log into a remote system
change to a specified directory
copy local files to the remote system
quit ftp
wait until the next schedule
How can I get FTP to do with without user interaction?
Thanks.
I think you can get hint from the following example
syntax
ftp -s:test.scr
test.scr file conatins the following things
open <servername>
userid
password
cd /home/hypadm/ctl
prompt
mget *
bye
ftp with "-i" options disables interactive mode.
man ftp. Find out -i option
ftp -i <servername>
The -s option works in Windows, but not in UNIX. I tried that before I posted.
jyoung
December 10, 2007, 2:21pm
6
If you do a search of the forums on FTP Scripting you should find many useful examples. Also check out the FAQS section. To automate it you could use cron. Do a search on that and you should find the info you need.
I searched before I posted. "No results". Yeah, I couldn't believe it either.
Still couldn't find anything in search, but I got something to work.
sed s/File/File2/g <location of command file> | ftp -inv
ftp command file content:
open <server ip>
user username password
lcd /dir
cd /dir
type binary
mput *
quit
Thanks for the responses.