Wartbarkeit, Stabilität und Effektivität

Fehlermeldung

Warning: file_exists(): open_basedir restriction in effect. File(/simple_html_dom.php) is not within the allowed path(s): (/var/lib/nginx/tmp/client:/var/www:/usr/bin:/dev/urandom:/proc/meminfo:/var/log/php) in _simplhtmldom_get_library_path() (Zeile 27 von sites/all/modules/simplehtmldom/helper.inc).

MySQL Backup per Mercurial!

2009-11 16
Mo, 2009-11-16 15:37 -- mig

#!/bin/bash
based=/var/backup_dir
pass=secret
 
function usage() {
    echo "Usage: `basename $0` [-db <database>|-list|-pull <host>|-commit]*"
    if [[ -n "$1" ]]; then
        echo "Unknown parameter $1 "
    fi
    exit $E_BADARGS
}
 
function listdbs() {
    echo "SHOW DATABASES;" | mysql -uroot -p$pass
}
 
 
function dumpDaten() {
    install -g mysql -o mysql -d $based/$db
    mysqldump -uroot -p$pass -f --skip-comments --single-transaction -T $based/$db $db
 
    cd $based/$db
    hg addremove -s 70
}
 
function commit() {
    cd $based
    hg commit -m "backup $(date '+%Y%m%d %H:%M')" 2> /dev/null
}
 
function pull() {
    cd $based
    hg pull https://$host/$based
}
 
# --- main
VERBOSE=1
if [[ "$1" == "-q" ]]; then
    VERBOSE=0
    shift
fi
if [[ ! -n "$1" ]]; then
    usage
fi
 
while [ "x$1" != "x" ]
do
    case $1 in
        "-list")   listdbs ;;
        "-db")     db=$2;    shift ;  dumpDaten ;;
        "-pull")   host=$2;  shift ;  pull ;;
        "-commit") commit ;;
        *)         usage $1 ;;
    esac
    shift
done
 
#vim:set ts=4

mysql_dump --ignore-table=db_name.tbl_namehg -X cache