Current time: 11-26-2024, 06:25 PM Hello There, Guest! (LoginRegister)


Post Reply 
How to setup a server to follow development?
Author Message
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #17
RE: How to setup a server to follow development?
It`s lazy but not crazy. As a matter of facts, it`s searching for trouble becose this force me to learn more. It`s not a productive server, it`s only for playing. I also added
Quote:tar czpf "ispcp_backup-etc-`date +'%Y-%m-%d %H-%M-%S'`.tar.gz" /etc/ispcp/
, if something go wrong i can allways roll back changes. Ispcp database it`s also saved via cron BEFORE runing this cron. I also have a background with vhcs2, and I also want to migrate a server to ispcp. This is a reason for serching for trouble Smile . For thos who may need, this is the script for save all databases from my system
Quote:#!/bin/bash
export d=$(date +"%Y-%m-%d")
export savepath='/home/htdocs/mysql'
mkdir -p $savepath/$d
for a in `echo "show databases" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
do
if [ $a != 'mysql' ]; then
if [ $a != 'information_schema' ]; then
mkdir -p $savepath/$d/$a
for i in `echo "show tables" | mysql --defaults-file=/home/sci2tech/.my.cnf -s $a`;
do
mysqldump --defaults-file=/home/sci2tech/.my.cnf --add-drop-table --allow-keywords -q -a -c $a $i > $savepath/$d/$a/$i.sql
done
fi
fi
done
tar -C$savepath -c -j -f$savepath/$d.tar.bz2 $d
rm -rf $savepath/$d
.my.cnf
Quote:[client]
user=USER_USUALY_ROOT
password=YOURPASSWORD
I don`t take credit for this it`s found on net and slightly modified .
(This post was last modified: 05-13-2008 03:37 AM by sci2tech.)
05-13-2008 03:36 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to setup a server to follow development? - sci2tech - 05-13-2008 03:36 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)