Shell Scripts

Using the ‘expect’ Command To Automate Interaction With Programs

From the expect man page:
Expect is a program that "talks" to other interactive programs according to a script. Following the script, Expect knows what can be expected from a program and what the correct response should be. An interpreted language provides branching and high-level control structures to direct the dialogue. In addition, the user can take control and interact directly when desired, afterward returning control to the script.

At the institution for which I work, I am responsible for our Sungard HE Banner ERP system. One of the development tasks that I was presented with was to automatically run a binary file at 10pm every night. The challenge was that this program was interactive and required the user to input answers to prompts. This sounded like a perfect use of the Unix program expect.

Backing Up A MySQL Database with AutoMySQLBackup

Are you looking to backup your MySQL database? My site runs with MySQL as its backend database, and as such I wanted a backup script I can just drop in.

I have found a great open source utility called AutoMySQLBackup which can be downloaded from SourceForge.net. There is no need to reinvent the wheel writing your own, this one works extremely well.

Here are the steps I followed to configure this script.

1) Download the script from the AutoMySQLBackup site on sourceforge. My examples are based off of version 2.5 of this script.

Syndicate content
v2.0