Posts Tagged "automation"

Fun with “expect”

»Posted by on Mar 27, 2012 in Blog, Coding, Systems Administration, Technology thoughts, Utilities | 0 comments

Fun with “expect”

A few years ago, I had call to automate some file transfers from one system to another. However, for security purposes, FTP was not an option. (It probably shouldn’t ever be on production systems–throw up a VM for that so when A Bad Thing happens, you can easily reconstitute that point of entry).It was at that point that I discovered the handy Tcl-based *nix utility expect. expect is nothing more than a simple call/response program, but oh, the places you can go. For instance, here’s a simple script that grabs backup files from one server and transfers them to the backup_archives directory on the local server. This example uses password authentication, but if you use keys, just add the -i /path/to/key.pem line in the scp spawn...

read more