Wiki ⇒ Tips and Tricks ⇒ CPG Dragonfly™ CMS
Wiki ⇒ Tips and Tricks

Glossary
The Project
Install
Upgrading or Switching
Dragonfly admininistration
Dragonfly public view
Dragonfly Themes
Build local server
Tips and Tricks
Rules & Regulations
v9 Developer's Manual
v10 Developer's manual
Wiki Permissions
10: Tips and Tricks
How to get the most out of your Dragonfly website

i. Data Backup

How 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

Created: Wednesday, February 23, 2005 (14:24:38) by Trevor
Updated: Monday, October 24, 2005 (09:55:27) by gaban