Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 10-18-2008, 10:17 AM   #1
LQ Newbie
Registered: Oct 2008
Posts: 15

Rep: Reputation: 0
Expect script to automate ftp upload

spawn ftp
expect "Name (ftp.remotedomain:root):"
send "username\r" //provide the username here
expect "Password:"
send "password\r" //provide the password here
expect "ftp>"
send "lcd /var/log/httpd\r" //any desired location
expect "ftp>"
send "put *.acslog\r" //any file
expect "ftp>"
send "bye\r"

Hope the script is self explanatory. You need to have "expect" rpm installed on the server and you can run it as
#expect scriptname
or you can put the above command in a file and can make it a bash executable.

With little modifications you can use this script for automating ssh logging also.
If anyone want help on that just post it here I will post taht code also
Old 10-18-2008, 11:36 AM   #2
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 377Reputation: 377Reputation: 377Reputation: 377
NOTE TO ALL: This thread is scheduled for closure, please use this one instead.

Last edited by win32sux; 10-18-2008 at 11:38 AM.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Expect script to automate ftp upload mabin Linux - Security 1 10-18-2008 11:29 AM
Expect script to automate ftp upload mabin Linux - General 1 10-18-2008 07:08 AM
script to automate EDI by FTP wademac Programming 4 04-14-2008 01:34 PM
Automate FTP session using Shell Script kalyanofb Programming 2 04-07-2007 08:44 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration