LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
Expect script to automate ftp upload


#!/usr/bin/expect
spawn ftp ftp.remotedomain.com
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"
#interact

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
win32sux
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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