PERL vs. Shell scripting for server automation.
Matt Graham
danceswithcrows at usa.net
Wed May 19 18:12:48 MST 2010
From: keith smith <klsmith2020 at yahoo.com>
> Now I'm wondering what would be better PERL or Shell for doing
> stuff like writing a backup script that might stop MySql, make a
> copy (dump?) , tar it and maybe move the tarball or place it on
> another server?
I'd use Perl for this, but you could also use PHP or Ruby or (insert
Turing-complete language here). The main disadvantage of shell is that its
syntax isn't as easy for doing programming things as some other languages,
it's not as easy to do math or complex data structures in shell, and shell can
require spawning many other processes.
> As you might have gathered from my last couple of questions I am
> not a sys admin. I'm a programmer and am responsible for several
> servers, so I guess I need to break down and learn a few more skills.
Perl is a great sysadmin language; it's like a Swiss Army Chainsaw that
contains an infinite length of duct tape :-) The key to Perl is the same as
the key to many other languages: Don't get too clever, write comments that
document what's going on, and keep the comments in sync with the code.
Otherwise you'll end up swearing at yourself at 0-dark-thirty while people ask
you when the server's going to be up.
--
Matt G / Dances With Crows
The Crow202 Blog: http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see
More information about the PLUG-discuss
mailing list