On Wed, 07 Mar 2001 04:00:33 K.Deepak wrote:
>Can anyone suggest me some good tool to do a automatic
>file upload in linux.

Add the server to your ~/.netrc like this:

  machine FTPSERVER login MYUSERNAME password MYPASSWORD
  default login anonymous password [EMAIL PROTECTED]

The second line creates an easy way for yoy to login to anonymous FTP
servers. The file should be readable only by you because it contains
passwords (chmod 600 ~/.netrc).

Then do an FTP session and keep track of the commands you use. Create a
script file with those commands:

  lcd somelocaldir
  cd someremotedir
  binary
  put thisfile
  put thatfile
  put theotherfile
  quit

Then you should be able to run an automated session like this:

  ftp FTPSERVER < ftpscript > ftplog

The good thing about this method is that if you already know how to use
command line FTP then you don't have to learn anything new. The bad part is
that command line FTP does not handle errors very well. So if the connection
times out or fails, there is no easy way to tell the script to retry or
report the failure. The only thing you can do is check the ftplog to see
what happened during the session.

If you need better error handling, try the "wget" utility. I believe it
ships with Red Hat.

Tony
-- 
Anthony E. Greene <[EMAIL PROTECTED]> <http://www.pobox.com/~agreene/>
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
Chat:  AOL/Yahoo: TonyG05    ICQ: 91183266
Linux. The choice of a GNU Generation. <http://www.linux.org/>



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to