[ale] automating an ssh script?
Mike Lockhart
backpacker at hikers.net
Fri Jul 26 17:28:01 EDT 2002
Have you tried Expect? I use it for several tasks of this sort. There
is a program that comes with Expect called 'auto-expect' that will
record your actions. You run the program, type all your commands, then
exit after you've finished. Then just modify the expect script to tweak
it out (timeouts and all). Hope this helps.
On Wed, 2002-07-24 at 21:44, ChangingLINKS.com wrote:
> Yo yo yo! <- New York Santa Claus
>
> I am trying to automate the script below. I want to click on a menu item on
> my desktop and have all of these commands get executed sequentially.
> Currently, I paste them in the terminal one by one and I have to enter a
> password three times (where "PASSWORD" is below). Anyone know how to automate
> this deal with the PASSWORDS entered. If it is to be one script, I may have
> to exit (as show below) to do the scp. Anyone?
>
>
> BACKING UP WEB SITE WITH MYSQL DATABASE
>
> ssh user at host.com
> PASSWORD
> mysqldump -h db1.host.com -u user -ppassword user>/home/user/dbbackup.txt
> tar cfvz /home/user/backup.tgz /home/user --exclude backup.tgz
> exit
> scp user at host.com:/home/user/backup.tgz /data/save/code
> PASSWORD
> ssh user at host.com
> PASSWORD
> rm /home/user/dbbackup.txt
> rm /home/user/backup.tgz
> --
> Wishing you Happiness, Joy and Laughter,
> Drew Brown
> http://www.ChangingLINKS.com
>
> ---
> This message has been sent through the ALE general discussion list.
> See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
> sent to listmaster at ale dot org.
>
--
================================
Michael Lockhart - PHP Developer
Intercosmos Media Group
mailto:mlockhart at intercosmos.com
http://orbital.intercosmos.net
================================
This is a digitally signed message part
More information about the Ale
mailing list