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
. 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 .