Installare su CentOS con:
yum install rsnapshot
[Read More]
Importare o esportare un database mysql
Esempio di esportazione:
mysqldump -u utente --password=password nome_database > /tmp/nome_db.sql
[Read More]
Crontab generator
https://www.easycron.com/generator/crontab
Backup tutti i databases mysql in files separati
#! /bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_DIR="/tmp/$TIMESTAMP"
MYSQL_USER="root"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="password"
MYSQLDUMP=/usr/bin/mysqldump
mkdir -p "$BACKUP_DIR/mysql"
databases=`$MYSQL --user=$MYSQL_USER -p$MYSQL_PASSWORD -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|performance_schema)"`
for db in $databases; do
$MYSQLDUMP --force --opt --user=$MYSQL_USER -p$MYSQL_PASSWORD --databases $db | gzip > "$BACKUP_DIR/mysql/$db.gz"
done
Creare pagina phpinfo.php
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>