Saturday, January 12, 2008

Practical Extraction and Reporting Language

if (U != geek) {
Don't read this post, it has a high geek quotient.
else {


I have been busy doing some PERL coding of late. I was getting geared up to deploy an e-commerce website. Well, such sites should be backed up on a regular basis so not wanting to do it manually every day I wrote a PERL script to do it. It is triggered by cron overnight and looks through the customer's web directory making a list of every file it finds under the web directory (it recurses through sub-directories so it does find everything) and packs everything up into a tarball. Then early in the morning my workstation (again via cron) fires off another PERL script to pull that tarball from the remote server to my workstation.

After the usual tweaking and fiddling I got it all to work and managed to extract all of the files out onto my workstation.

So, this morning I took those nifty scripts and I enabled it to have the critical system dependent information (system specific paths and IDs and the like) passed in via command line parameter. Now, instead of editing the script every time I want to deploy it to another website, I just set up a shell script calling the backup script with the correct positional parameters.

The next trick I need to figure out is how to get the databases backed up. I found some help there, but it seems like host security setups may not permit me to use those techniques, I hope they can be overcome.

return 1;

Labels: , ,