Wiki ⇒ Tips and Tricks | Edit this page
• Glossary • The Project • Install • Dragonfly admin interface • Dragonfly public view • Dragonfly Themes • Build local server • Running Dragonfly CVS • Tips and Tricks • Rules & Regulations • Search the Wiki • Developer's Manual
|
10: Tips and TricksHow to get the most out of your Dragonfly websitei. Data BackupHow to easily backup your files and database.
i.a Fast thru PHP on Linux (doesn't work in safe_mode)
<?php
require_once('config.php');
set_time_limit(0);
header("Content-Type: application/x-gzip; name=\"$dbname.sql.gz\"");
header("Content-disposition: attachment; filename=$dbname.sql.gz");
passthru("mysqldump -f -h$dbhost -u$dbuname -p$dbpass $dbname --add-drop-table | gzip -9cf");
i.b CronJob/SSH
Create a file called mysqlbackup.sh
#! /bin/sh
DBNAME=here
DBUSER=root
DBPASS=fill_in
FILE1=${DBNAME}-`date +%Y%m%d%H%M`.sql
DIR=/home/YOURNAME/
mysqldump -f -hlocalhost -u${DBUSER} -p${DBPASS} --add-drop-table ${DBNAME} | gzip -9c >${DIR}${FILE1}.gz
|
| | Author: Trevor Created: Onsdag, 23 Februar 2005 (14:24:38) Last update: Mandag, 24 Oktober 2005 (09:55:27) by gaban |

|