Batching an ftp session under linux

A very useful script to transfer a file in FTP without interaction.
You can schedule in crontab to trasfer everything you want to a server. simply adjust parameter and voilĂ ...
To GET a file instead of PUT simply change the line

  1.  
  2. put $FILE
  3.  

to

  1.  
  2. get $FILE
  3.  

This is the code..

  1.  
  2. #!/bin/sh
  3. HOST=your.ftp.server
  4. USER=username
  5. PASS=password
  6. FILE=file.to.transfer
  7. ftp -n<<eof
  8. open $HOST
  9. quote user $USER
  10. quote pass $PASS
  11. put $FILE
  12. bye
  13. EOF
  14.  

Comments (0)

› No comments yet.

Leave a Reply


*