NAME
Zanas::Install - create/update/backup/restore Zanas.pm based WEB applications.
SYNOPSIS
#perl -MZanas::Install -e create
# create a new application
#cd /path/to/app/
#perl -MZanas::Install -e backup
# create a backup (db dump and libs) in /path/to/app/snapshots/
#cd /path/to/app/
#perl -MZanas::Install -e restore 2004-1-1-0-0-0
# restore /path/to/app/snapshots/2004-1-1-0-0-0.tar.gz
#cd /path/to/app/
#perl -MZanas::Install -e backup_master
# create a backup on master server
#cd /path/to/app/
#perl -MZanas::Install -e sync_down
# create a backup on master and then restore it on local server
DESCRIPTION
Zanas::Install is a set of tools to maniputate Zanas.pm based WEB applications. Its aim is to automate common support tasks like copying/renaming multiple *.pm files, dumping/restoring databases et caetera.
Creating a new application
No more need to manually create MySQL database, set permissions and clone *.pm library from existing application. Simply punch perl -MZanas::Install -e create
and enter all asked values interactively.
At the end of this process you'll need to perform the only administrative task: link the new created application specific httpd.conf
from the global Apache configuration.
Backup/restore
You can take the snapshot of the working application, store it locally and then restore. The snapshot consists of the database dump and all files in lib/ directory.
On the command backup
all of it is packed, named $year-$month-$day-$hour-$minute-$second.tar.gz and then stored in snapshots
directory.
On the command restore $year-$month-$day-$hour-$minute-$second
the old state returns. Caution! You are responsible to backup the current state before restore the old one.
Replication.
It's common case when an application exists in different places in different versions. Say, you have development, testing and production servers. As usual, you have to mirror down the testing and the production snaphots to the development server and replicate the development libraries up to the testing and the production servers.
Each Zanas based application can have a 'master': testing insatllation is a master one for development and production insatllation is a master one for testing. The master insatllation is pointed in httpd.conf file as follows:
<perl>
...
our $preconf = {
...
master_server => {
user => 'ssh_user',
host => 'ssh_host',
path => '/path/on/remote/server',
},
};
</perl>
Now if the host is accessible with the SSH protocol without the password (key pairs are OK) or ssh_host eq 'localhost'
you can replicate the application up and down.
The sync_down
command generates the application snapshot on the master, copies it to the local server and restores it here.
SEE ALSO
Zanas
AUTHORS
Dmitry Ovsyanko <do@zanas.ru>